Search Results

Search found 32382 results on 1296 pages for 'render html'.

Page 12/1296 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Height of a html window's content (not just the viewport height)

    - by gatapia
    Hi All, I'm trying to get the height of a html window's content. This is the full height of the content not the visible height. I have had some (very limited) success using: document.getElementsByTagName('html')[0].offsetHeight in FireFox. This however fails in IEs and it fails in Chrome when using absolute positioned elements (http://code.google.com/p/chromium/issues/detail?id=38999). A sample html file that can be used to reproduce this is: <html> <head> <style> div { border:solid 1px red; height:2000px; width:400px; } .broken { position:absolute; top:0; left:0; } .fixed { position:relative; top:0; left:0; } </style> <script language='javascript'> window.onload = function () { document.getElementById('window.height').innerHTML = window.innerHeight; document.getElementById('window.screen.height').innerHTML = window.screen.height; document.getElementById('document.html.height').innerHTML = document.getElementsByTagName('html')[0].offsetHeight; } </script> </head> <body> <div class='fixed'> window.height: <span id='window.height'>&nbsp;</span> <br/> window.screen.height: <span id='window.screen.height'></span> <br/> document.html.height: <span id='document.html.height'></span> <br/> </div> </body> </html> Thanks All Guido Tapia

    Read the article

  • HTML inside webView

    - by Samuh
    I am posting some data to a server using DefaultHttpClient class and in the response stream I am getting a HTML file. I save the stream as a string and pass it onto another activity which contains a WebView to render this HTML on the screen: response = httpClient.execute(get); InputStream is = response.getEntity().getContent(); BufferedReader br = new BufferedReader(new InputStreamReader(is,"utf-8")); StringBuffer sb = new StringBuffer(); String line; while((line=br.readLine())!=null){ sb.append(line); sb.append("\n"); } is.close(); Intent intent = new Intent(this,Trial.class); intent.putExtra("trial",sb.toString()); startActivity(intent); Log.i("SB",sb.toString()); In Second Activity, the code to load the WebView reads: WebView browser = ((WebView)findViewById(R.id.trial_web)); browser.getSettings().setJavaScriptEnabled(true); browser.loadData(html,"text/html", "utf-8"); When I run this code, the WebView is not able to render the HTML content properly. It actually shows the HTML string in URL encoded format on the screen. Interestingly, If I copy the Loggers output to HTML file and then load this HTML in my WebView(using webview.loadurl(file:///assets/xyz.html)) everything works fine. I suspect some problem with character encoding. What is going wrong here? Please help. Thanks.

    Read the article

  • multiple Perl ` print $cgi->header, <<HTML; .... HTML ` statement gives problem

    - by dexter
    i have something like: #!/usr/bin/perl use strict; use warnings; use CGI::Simple; use DBI; my $cgi = CGI::Simple->new; if ($cgi->param('selid')) { print $cgi->header, <<HTML; <br/>this is SELECT HTML } elsif ($cgi->param('delid')) { print $cgi->header, <<HTML; <b>this is DELETE</b> HTML } elsif ($cgi->param('upid')) { print $cgi->header, <<HTML; <b>this is UPDATE</b> HTML } when i run this i get an error like: Error message: Can't find string terminator " HTML" anywhere before EOF at C:/xampp/htdocs/perl/action.pl line 14. , and when give space between << and HTML; like :print $cgi->header, << HTML; error changes to: Error message: Can't find string terminator " " anywhere before EOF at C:/xampp/htdocs/perl/action.pl line 14. , what would be the reason for this? note: parameters are passed from another page('selid' or 'delid' or 'upid')

    Read the article

  • embedded php in html to include header (top part of page) into the page

    - by Andy
    Hi there, I'm trying to put the top of my page (which is all html) in a seperate file so I only need to change things once like the menu bar etc. So I googled some and found a solution on this website as well, but it doesn't work and I don't know why. So I have a page like article.html and on the top I have this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <?php include("/pages/header.php"); ?> <!-- rest of the html code --> In the header.php I have the html that should be on the top of each page and it starts with: <?php /** * @author name * website header */ ?> <!-- html code --> So what's wrong with this. When I open the page article.html and right click on it to view the source, I can see the php from above calling the header.php file. Thanks!

    Read the article

  • Easy way to "organize"/"render"/"generate" HTML?

    - by Rockmaninoff
    Hi all, I'm a relative newbie to web development. I know my HTML and CSS, and am getting involved with Ruby on Rails for some other projects, which has been daunting but very rewarding. Basically I'm wondering if there's a language/backbone/program/solution to eliminate the copypasta trivialities of HTML, with some caveats. Currently my website is hosted on a school server and unfortunately can't use Rails. Being a newbie I also don't really know what other technologies are available to me (or even what those technologies might be). I'm essentially looking for a way to auto-insert all of my header/sidebar/footer/menu information, and when those need to be updated, the rest of the pages get updated. Right now, I have a sidebar that is a tree of all of the pages on my website. When I add a page, not only do I need to update the sidebar, I have to update it for every page in my domain. This is really inefficient and I'm wondering if there is a better way. I imagine this is a pretty widespread problem, but searching Google turns up too many irrelevant links (design template websites, tutorials, etc.). I'd appreciate any help. Oh, and I've heard of HAML as a way to render HTML; how would it be used in this situation?

    Read the article

  • PGU HTML Renderer can't render most sites

    - by None
    I am trying to make a web browser using pygame. I am using PGU for html rendering. It works fine when I visit simple sites, like example.com, but when I try and load anything more complex that uses an html form, like google, I get this error: UnboundLocalError: local variable 'e' referenced before assignment I looked in the PGU html rendering file and found this code segment: def start_input(self,attrs): r = self.attrs_to_map(attrs) params = self.map_to_params(r) #why bother #params = {} type_,name,value = r.get('type','text'),r.get('name',None),r.get('value',None) f = self.form if type_ == 'text': e = gui.Input(**params) self.map_to_connects(e,r) self.item.add(e) elif type_ == 'radio': if name not in f.groups: f.groups[name] = gui.Group(name=name) g = f.groups[name] del params['name'] e = gui.Radio(group=g,**params) self.map_to_connects(e,r) self.item.add(e) if 'checked' in r: g.value = value elif type_ == 'checkbox': if name not in f.groups: f.groups[name] = gui.Group(name=name) g = f.groups[name] del params['name'] e = gui.Checkbox(group=g,**params) self.map_to_connects(e,r) self.item.add(e) if 'checked' in r: g.value = value elif type_ == 'button': e = gui.Button(**params) self.map_to_connects(e,r) self.item.add(e) elif type_ == 'submit': e = gui.Button(**params) self.map_to_connects(e,r) self.item.add(e) elif type_ == 'file': e = gui.Input(**params) self.map_to_connects(e,r) self.item.add(e) b = gui.Button(value='Browse...') self.item.add(b) def _browse(value): d = gui.FileDialog(); d.connect(gui.CHANGE,gui.action_setvalue,(d,e)) d.open(); b.connect(gui.CLICK,_browse,None) self._locals[r.get('id',None)] = e I got the error in the last line, because e wasn't defined. I am guessing the reason for this is that the if statement that checks the type of the input and creates the e variable didn't match anything. I added a line to print the _type variable and I got 'hidden' when i tried google and apple. Is there any way to render form items that have the type 'hidden' with PGU?

    Read the article

  • HTML/CSS - How can I position these nested unordered lists correctly?

    - by Samuroid
    I am looking for some help resolving an issue im having with positioning the following unordered list elements that are contained in a div which has relative positioning: The html structure of the UL: <div id="accountBox" class="account_settings_box"> <ul> <ul> <li class="profileImage"><img src="images/profileimage.jpg" alt="Profile Image" /></li> <li class="profileName">Your name</li> <li class="profileEmail">Your email</li> </ul> <li><a href="">Messages</a></li> <li><a href="">Settings</a></li> <li><a href="">Password</a></li> <li><a href="">Sign out</a></li> </ul> </div> and the CSS for this list: .account_settings_box ul ul { display: inline-block; margin: 0; padding: 0; width: 100%; height: 150px; outline: 1px solid blue; } .account_settings_box ul ul li { display: inline-block; border: none; /* Reset the border */ } .profileImage { float: right; display: block; width: 150px; height: 150px; outline: 1px solid purple; } .profileName, .profileEmail { width: auto; height: auto; width: 150px; height: 150px; } .account_settings_box ul ul li:hover { outline: 1px solid red; } .profileImage img { width: 150px; height: 150px; } I am having difficultly with the embedded ul, i.e, .account_settings_box ul ul element. The image below shows what it currently looks like. I am trying to achieve the follow: Have the image floating to the right, and have the "your name" and "your email" positioned to the left of the image (basically where they are currently). Thanks for your help in advance. Sam :)

    Read the article

  • HTML: <textarea>-Tag: How to correctly escape HTML and JavaScript content displayed in there?

    - by jens
    Hello, I have a HTML Tag <textarea>$FOO</textarea> and the $FOO Variable will be filled with arbitrary HTML and JavaScript Content, to be displayed and edited within the textarea. What kind of "escaping" do I neet to apply to $FOO? I first tought of escaping it HTML but this didnt work (as I will then get shown not the original HTML Code of $FOO but rather the escaped content. This is of course not what I want: I want to be displayed the unescaped HTML/JS Content of the variable... Is it impossible to display HTML Content within a <textarea> tag and also allow it to be editable as full HTML? thanks jens

    Read the article

  • Trying to parse links in an HTML directory listing using Java regex

    - by DiskCrasher
    Ok I know everyone is going to tell me not to use RegEx for parsing HTML, but I'm programming on Android and don't have ready access to an HTML parser (that I'm aware of). Besides, this is server generated HTML which should be more consistent than user-generated HTML. The regex looks like this: Pattern patternMP3 = Pattern.compile( "<A HREF=\"[^\"]+.+\\.mp3</A>", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); Matcher matcherMP3 = patternMP3.matcher(HTML); while (matcherMP3.find()) { ... } The input HTML is all on one line, which is causing the problem. When the HTML is on separate lines this pattern works. Any suggestions?

    Read the article

  • Download HTML and Images with WGet without first few lines

    - by St. John Johnson
    I'm attempting to use wget with the -p option to download specific documents and the images linked in the HTML. The problem is, the site that is hosting the HTML has some non-html information preceding the HTML. This is causing wget to not interpret the document as HTML and doesn't search for images. Is there a way to have wget strip the first X lines and/or force searching for images? Example URL: http://www.sec.gov/Archives/edgar/data/13239/000119312510070346/ds4.htm First Lines of Content: <DOCUMENT> <TYPE>S-4 <SEQUENCE>1 <FILENAME>ds4.htm <DESCRIPTION>FORM S-4 <TEXT> <HTML><HEAD> <TITLE>Form S-4</TITLE> Last Lines of Content: </BODY></HTML> </TEXT> </DOCUMENT>

    Read the article

  • HTML is not being interpreted after JQuery's .ajax function

    - by Casidiablo
    Hello there... Once I have retrived an HTML string with the $.ajax function I put it into a div... the HTML is a simple message with a <b> tag, but it's not being interpreted by the browser, I mean, the <b> is not making the text bold. Here is what I do: $.ajax({ url: 'index.php?ajax=ejecutar_configuracion&id_gadget=cubrimientos', cache: false, success: function(html){ // html = '<b>hello</b> newton' $('#config_reporte').html(html).dialog({ height: 300, width: 500, modal: true }); } }); As you can see, I'm writing the content of the HTML result into a modal dialog window. Does anybody know why is this happening? This should be something easy to do... but I haven't been able to make it work properly. Thank you so much.

    Read the article

  • Using multiple column layout with HTML 5 and CSS 3

    - by nikolaosk
    This is going to be the fourth post in a series of posts regarding HTML 5. You can find the other posts here , here and here.In this post I will provide a hands-on example with HTML 5 and CSS 3 on how to create a page with multiple columns and proper layout.I will show you how to use CSS 3 to create columns much easier than relying on DIV elements and the float CSS rule.I will also show you how to use browser-specific prefix rules (-ms for Internet Explorer and -moz for Firefox ) for browsers that do not fully support CSS 3.In order to be absolutely clear this is not (and could not be) a detailed tutorial on HTML 5. There are other great resources for that.Navigate to the excellent interactive tutorials of W3School.Another excellent resource is HTML 5 Doctor.Two very nice sites that show you what features and specifications are implemented by various browsers and their versions are http://caniuse.com/ and http://html5test.com/. At this times Chrome seems to support most of HTML 5 specifications.Another excellent way to find out if the browser supports HTML 5 and CSS 3 features is to use the Javascript lightweight library Modernizr.In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor you like.You can use Visual Studio 2012 Express edition. You can download it here.I will create a simple page with information about HTML 5, CSS 3 and JQuery. This is the full HTML 5 code. <!DOCTYPE html><html lang="en">  <head>    <title>HTML 5, CSS3 and JQuery</title>    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >    <link rel="stylesheet" type="text/css" href="style.css">       </head>  <body>    <div id="header">      <h1>Learn cutting edge technologies</h1>      <p>HTML 5, JQuery, CSS3</p>    </div>    <div id="main">      <div id="mainnews">        <div>          <h2>HTML 5</h2>        </div>        <div>          <p>            HTML5 is the latest version of HTML and XHTML. The HTML standard defines a single language that can be written in HTML and XML. It attempts to solve issues found in previous iterations of HTML and addresses the needs of Web Applications, an area previously not adequately covered by HTML.          </p>          <div class="quote">            <h4>Do More with Less</h4>            <p>             jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.             </p>            </div>          <p>            The HTML5 test(html5test.com) score is an indication of how well your browser supports the upcoming HTML5 standard and related specifications. Even though the specification isn't finalized yet, all major browser manufacturers are making sure their browser is ready for the future. Find out which parts of HTML5 are already supported by your browser today and compare the results with other browsers.                      The HTML5 test does not try to test all of the new features offered by HTML5, nor does it try to test the functionality of each feature it does detect. Despite these shortcomings we hope that by quantifying the level of support users and web developers will get an idea of how hard the browser manufacturers work on improving their browsers and the web as a development platform.</p>        </div>      </div>              <div id="CSS">        <div>          <h2>CSS 3 Intro</h2>        </div>        <div>          <p>          Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG and XUL.          </p>        </div>      </div>            <div id="CSSmore">        <div>          <h2>CSS 3 Purpose</h2>        </div>        <div>          <p>            CSS is designed primarily to enable the separation of document content (written in HTML or a similar markup language) from document presentation, including elements such as the layout, colors, and fonts.[1] This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple pages to share formatting, and reduce complexity and repetition in the structural content (such as by allowing for tableless web design).          </p>        </div>      </div>                </div>    <div id="footer">        <p>Feel free to google more about the subject</p>      </div>     </body>  </html>  The markup is very easy to follow. I have used some HTML 5 tags and the relevant HTML 5 doctype.The CSS code (style.css) follows  body{        line-height: 30px;        width: 1024px;        background-color:#eee;      }            p{        font-size:17px;    font-family:"Comic Sans MS"      }      p,h2,h3,h4{        margin: 0 0 20px 0;      }            #main, #header, #footer{        width: 100%;        margin: 0px auto;        display:block;      }            #header{        text-align: center;         border-bottom: 1px solid #000;         margin-bottom: 30px;      }            #footer{        text-align: center;         border-top: 1px solid #000;         margin-bottom: 30px;      }            .quote{        width: 200px;       margin-left: 10px;       padding: 5px;       float: right;       border: 2px solid #000;       background-color:#F9ACAE;      }            .quote :last-child{        margin-bottom: 0;      }            #main{        column-count:2;        column-gap:20px;        column-rule: 1px solid #000;        -moz-column-count: 2;        -webkit-column-count: 2;        -moz-column-gap: 20px;        -webkit-column-gap: 20px;        -moz-column-rule: 1px solid #000;        -webkit-column-rule: 1px solid #000;      }       All the rules in the css code are pretty simple. The layout is achieved with that CSS rule #main{        column-count:2;        column-gap:20px;        column-rule: 1px solid #000;        -moz-column-count: 2;        -webkit-column-count: 2;        -moz-column-gap: 20px;        -webkit-column-gap: 20px;        -moz-column-rule: 1px solid #000;        -webkit-column-rule: 1px solid #000; Do note the column-count,column-gap and column-rule properties. These properties make the two column layout possible.Please have a look at the picture below to see why I used prefixes for Chrome (webkit) and Firefox(moz).It clearly indicates that the CSS 3 column layout are not supported from Firefox and Chrome.   Finally I test my simple HTML 5 page using the latest versions of Firefox,Internet Explorer and Chrome. In my machine I have installed Firefox 15.0.1.Have a look at the picture below to see how the page looks  I have installed Google Chrome 21.0 in my machine.Have a look at the picture below to see how the page looks Have a look at the picture below to see how my page looks in IE 10.  My page looks the same in all browsers. Hope it helps!!!

    Read the article

  • Cocoa WebView won't render all images on OSX 10.8

    - by user2906962
    I'm currently developing an application for OS X, backwards compatible with OS X 10.6. At some point I create a WebView in which I load html content that I create dynamically. The html content is formed only of image links <img src= and text, there is no javascript or anything of that kind. All the images (there are only 5 png images) are stored locally and their size is 4 KB. The problem I have is that some images (those that are not on the visible side of the "scroll"), the very first time I run the application,the images are not shown unless I drag the window to another screen or load again the view controller that contains the WebView. In those cases the images appear on the "scroll" even if they are offsite. I've tried creating the WebView both with IB and programatically, I've used WebPreferences like Autosaves, AllowsAnimatedImages … I've tried using NSURLCache to load each image so that the WebView will get access to them easier ... same result. Taking into account that my code is quite extensive I'm gonna post only the bits that I think are relevant: NSString *finalHtml ... //contains the complete html CGRect screenRect = [self.fixedView bounds]; CGRect webFrame = CGRectMake(0.0f, 0.0f, screenRect.size.width, screenRect.size.height); self.miwebView=[[WebView alloc] initWithFrame:webFrame]; [self.miwebView setEditable:NO]; [self.miwebView setUIDelegate:self]; ... NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil]; [NSURLCache setSharedURLCache:URLCache]; NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"line" ofType:@"png"]; NSURL *resourceUrl = [NSURL URLWithString:imagePath]; NSURLRequest *request = [NSURLRequest requestWithURL:resourceUrl cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0f]; [URLCache cachedResponseForRequest:request]; ... [self.miwebView setResourceLoadDelegate:self]; WebPreferences *webPref = [[WebPreferences alloc]init]; [webPref setAutosaves:YES]; [webPref setAllowsAnimatedImages:YES]; [webPref setAllowsAnimatedImageLooping:YES]; [self.miwebView setPreferences:webPref]; NSString *pathResult = [[NSBundle mainBundle] bundlePath]; NSURL *baseURLRes = [NSURL fileURLWithPath:pathResult]; [[self.miwebView mainFrame] loadHTMLString:finalHtml baseURL:baseURLRes]; [self.fixedView addSubview:self.miwebView]; I should also mention that if an image is caught somewhere in between the visible and non visible side of the "scroll" only the visible bit of the image is going to be rendered even if the page gets scrolled up ... so I think all this is some rendering issue ... I appreciate your help, thank you!

    Read the article

  • Command line tool to query HTML elements (linux)

    - by ipsec
    I am looking for a (linux) command line tool to parse HTML files and extract some elements, ideally with some XPath-like syntax. I have the following requirements: It must be able to parse arbitrary HTML files (which may contain errors) in a robust manner It must be able to extract text of elements and attributes What I have tried so far: xmlstarlet: would be perfect, but mostly reports errors in files (e.g. entity not defined), even xml fo or htmltidy does not help. xmllint: the best I have found so far, but is not able to extract attribute texts. Something like //a/@href reports <a href="foo">, what I need is just foo. string(//a/@href) works, but queries only the first entry. data is not supported. hxextract: works, but cannot extract attributes. XQilla: would support XPath 2.0 and thus data. It also support xqilla:parse-html, but I have had no luck making this work. Can you recommend me another tool?

    Read the article

  • Configure Thunderbird to never send (or even try to send) HTML emails

    - by Brent.Longborough
    Where can I set it to tell Thunderbird to always send as plain-text emails and never as HTML formatted messages? I hate HTML-based email, and always do everything possible to send my emails as plain text. Thunderbird is always pestering me with questions like "This recipient cannot receive HTML..." or "In order to sign this email, it needs to be converted to plain text..." Is there a way I can simply say to Thunderbird "Look, old chap, it's all plain text, so don't bother me any more, ever, again"?

    Read the article

  • Is there any website editor (html) for Firefox

    - by blade19899
    There are a lot of webdeveloper addons available, for Firefox, like firebug. But is there a html editor addon for Firefox. Which I can edit my website. Viewing the edits real-time (using localhost or via ftp?) and saving the edits(CTRL+S) I am currenlty using firebug and it would save a lot of time if I could save the (local) .html file using a firebug like addon!(or firebug itself?) I Found a firebug addon to save .css files... now just need one to save html, and I am good to go!

    Read the article

  • rewrite all .html extension and remove index in Nginx

    - by Pardoner
    How would I remove all .html extensions as well as any occurrences of index.html from a url string in Nginx http://www.mysite/index.html to http://www.mysite http://www.mysite/articles/index.html to http://www.mysite/articles http://www.mysite/contact.html to http://www.mysite/contact http://www.mysite/foo/bar/index.html to http://www.mysite/foo/bar EDIT: Here is my conf file: server { listen 80; server_name staging.mysite.com; root /var/www/staging.mysite.com; index index.html index.htm; access_log /var/log/nginx/staging.mysite.com.log spiegle; #error_page 404 /404.html; #error_page 500 503 /500.html; rewrite ^(.*/)index\.html$ $1; rewrite ^(/.+)\.html$ $1; rewrite ^(.*/)index\.html$ $scheme://$host$1 permanent; rewrite ^(/.+)\.html$ $scheme://$host$1 permanent; location / { rewrite ^/about-us /about permanent rewrite ^/contact-us /contact permanent; try_files $uri.html $uri/ /index.html; } }

    Read the article

  • Adding the New HTML Editor Extender to a Web Forms Application using NuGet

    - by Stephen Walther
    The July 2011 release of the Ajax Control Toolkit includes a new, lightweight, HTML5 compatible HTML Editor extender. In this blog entry, I explain how you can take advantage of NuGet to quickly add the new HTML Editor control extender to a new or existing ASP.NET Web Forms application. Installing the Latest Version of the Ajax Control Toolkit with NuGet NuGet is a package manager. It enables you to quickly install new software directly from within Visual Studio 2010. You can use NuGet to install additional software when building any type of .NET application including ASP.NET Web Forms and ASP.NET MVC applications. If you have not already installed NuGet then you can install NuGet by navigating to the following address and clicking the giant install button: http://nuget.org/ After you install NuGet, you can add the Ajax Control Toolkit to a new or existing ASP.NET Web Forms application by selecting the Visual Studio menu option Tools, Library Package Manager, Package Manager Console: Selecting this menu option opens the Package Manager Console. You can enter the command Install-Package AjaxControlToolkit in the console to install the Ajax Control Toolkit: After you install the Ajax Control Toolkit with NuGet, your application will include an assembly reference to the AjaxControlToolkit.dll and SanitizerProviders.dll assemblies: Furthermore, your Web.config file will be updated to contain a new tag prefix for the Ajax Control Toolkit controls: <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> <pages> <controls> <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /> </controls> </pages> </system.web> </configuration> The configuration file installed by NuGet adds the prefix ajaxToolkit for all of the Ajax Control Toolkit controls. You can type ajaxToolkit: in source view to get auto-complete in Source view. You can, of course, change this prefix to anything you want. Using the HTML Editor Extender After you install the Ajax Control Toolkit, you can use the HTML Editor Extender with the standard ASP.NET TextBox control to enable users to enter rich formatting such as bold, underline, italic, different fonts, and different background and foreground colors. For example, the following page can be used for entering comments. The page contains a standard ASP.NET TextBox, Button, and Label control. When you click the button, any text entered into the TextBox is displayed in the Label control. It is a pretty boring page: Let’s make this page fancier by extending the standard ASP.NET TextBox with the HTML Editor extender control: Notice that the ASP.NET TextBox now has a toolbar which includes buttons for performing various kinds of formatting. For example, you can change the size and font used for the text. You also can change the foreground and background color – and make many other formatting changes. You can customize the toolbar buttons which the HTML Editor extender displays. To learn how to customize the toolbar, see the HTML Editor Extender sample page here: http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/HTMLEditorExtender/HTMLEditorExtender.aspx Here’s the source code for the ASP.NET page: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Add Comments</title> </head> <body> <form id="form1" runat="server"> <div> <ajaxToolkit:ToolkitScriptManager ID="TSM1" runat="server" /> <asp:TextBox ID="txtComments" TextMode="MultiLine" Columns="50" Rows="8" Runat="server" /> <ajaxToolkit:HtmlEditorExtender ID="hee" TargetControlID="txtComments" Runat="server" /> <br /><br /> <asp:Button ID="btnSubmit" Text="Add Comment" Runat="server" onclick="btnSubmit_Click" /> <hr /> <asp:Label ID="lblComment" Runat="server" /> </div> </form> </body> </html> Notice that the page above contains 5 controls. The page contains a standard ASP.NET TextBox, Button, and Label control. However, the page also contains an Ajax Control Toolkit ToolkitScriptManager control and HtmlEditorExtender control. The HTML Editor extender control extends the standard ASP.NET TextBox control. The HTML Editor TargetID attribute points at the TextBox control. Here’s the code-behind for the page above:   using System; namespace WebApplication1 { public partial class Default : System.Web.UI.Page { protected void btnSubmit_Click(object sender, EventArgs e) { lblComment.Text = txtComments.Text; } } }   Preventing XSS/JavaScript Injection Attacks If you use an HTML Editor -- any HTML Editor -- in a public facing web page then you are opening your website up to Cross-Site Scripting (XSS) attacks. An evil hacker could submit HTML using the HTML Editor which contains JavaScript that steals private information such as other user’s passwords. Imagine, for example, that you create a web page which enables your customers to post comments about your website. Furthermore, imagine that you decide to redisplay the comments so every user can see them. In that case, a malicious user could submit JavaScript which displays a dialog asking for a user name and password. When an unsuspecting customer enters their secret password, the script could transfer the password to the hacker’s website. So how do you accept HTML content without opening your website up to JavaScript injection attacks? The Ajax Control Toolkit HTML Editor supports the Anti-XSS library. You can use the Anti-XSS library to sanitize any HTML content. The Anti-XSS library, for example, strips away all JavaScript automatically. You can download the Anti-XSS library from NuGet. Open the Package Manager Console and execute the command Install-Package AntiXSS: Adding the Anti-XSS library to your application adds two assemblies to your application named AntiXssLibrary.dll and HtmlSanitizationLibrary.dll. After you install the Anti-XSS library, you can configure the HTML Editor extender to use the Anti-XSS library your application’s web.config file: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <sectionGroup name="system.web"> <section name="sanitizer" requirePermission="false" type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit"/> </sectionGroup> </configSections> <system.web> <sanitizer defaultProvider="AntiXssSanitizerProvider"> <providers> <add name="AntiXssSanitizerProvider" type="AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider"></add> </providers> </sanitizer> <compilation debug="true" targetFramework="4.0" /> <pages> <controls> <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /> </controls> </pages> </system.web> </configuration> Summary In this blog entry, I described how you can quickly get started using the new HTML Editor extender – included with the July 2011 release of the Ajax Control Toolkit – by installing the Ajax Control Toolkit with NuGet. If you want to learn more about the HTML Editor then please take a look at the Ajax Control Toolkit sample site: http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/HTMLEditorExtender/HTMLEditorExtender.aspx

    Read the article

  • Prevent Coldfusion from encoding html

    - by cr1ms0n3cho
    I am trying to return html from <cfsavecontent variables="html"> <p>Some html</p> </cfsavecontent> <cfreturn html> But when it comes back from the function the html is encoded I found this thread http://www.coldfusionjedi.com/forums/messages.cfm?threadid=BB31B124-19B9-E658-9D3F5726B8607FD8 which has some solutions but im hoping for something a little less messy. Any help is appreciated! Thanks

    Read the article

  • How to insert html in iframe

    - by Massimo Ugues
    Hallo all: I need to insert a html string in a iframe as shown below: .... var html = "<html><head><title>Titolo</title></head><body><p>body</p></body></html>" jQuery('#popolaIframe').click(function() { parent.$("#indexIframe")[0].documentElement.innerHTML = html; }); Is there a way to achieve this? Kind regards Massimo

    Read the article

  • Searching for specific HTML string using Python

    - by Morpheous
    What modules would be the best to write a python program that searches through hundreds of html documents and deletes a certain string of html that is given. For instance, if I have an html doc that has <a href="test.html">Test</a> and I want to delete this out of every html page that has it. Any help is much appreciated, and I don't need someone to write the program for me, just a helpful point in the right direction.

    Read the article

  • Robust, Mature HTML Parser for PHP

    - by Alan Storm
    Are there any robust and mature HTML parsers available for PHP? A quick skimming of PEAR didn't turn anything up (lots of classes for generating HTML, not so much for consuming), and Google taught me a lot of people have started and then abandoned a variety of parser projects. Not interested in XML parsers (unless then can consume non-well formed HTML) or hacking it on my own with regular expressions. Clarification of Intent: I'm not interested in filtering of HTML content, I'm interesting in extracting information from HTML documents.

    Read the article

  • Html generate data and print from another page

    - by Hulk
    In the below code, in a.html there is this code as, <div id="tableview"></div>//Data loaded dynamically <input type="button" id="printbtn" onclick="print()"/> <script> function print() { var data=$('#tableview').html(); dataobj.print(); } In b.html I need to print a.html without opening it ,But without opening it how will the data in the div get generated and how to print only this data from b.html Thanks..

    Read the article

  • GET request in AJAX-retrieved HTML

    - by ufw
    There is some HTML code which appears on the page as the result of AJAX request/response. This HTML contains GET requests to another php script. Links containing this requests are not working while "real" HTML (added on the page manually) works normally. When I open the page source with Ctrl+U I see empty div's (but they actually have HTML retrieved via AJAX) and the full-fledged HTML code added manually. Can't figure out how can I make the AJAX-retrieved links working. This is how I try to form the HTML code which must be added to the page as the result of AJAX response. <?php //some selections from the database... //all subsequent varibles are the members of $row=(mysql_fetch_array($query)) array; $html_to_be_inactive = '<li id="productID_' . $productID . '"> <a href=work.php?action=deleteFromBasket&productID=' . $productID . ' onClick="return false;"> <img src="images/delete.png" id="deleteProductID_' . $productID . '"> </a> ' . $productName . '(' . $totalItems . ' items) - $' . ($totalItems * $productPrice) . '</li>'; echo $html_to_be_inactive; ?> And that is it, result of 'echo' appears on the page after successful AJAX request as the simple HTML, and it does nothing when I click the link. I do not perform DOM 'append' methods as I'm not familiar with DOM yet. I can see all the elements mentioned in $thml_to_be_inactive but the link seems to be really inactive. Also this HTML is absent in the "Ctrl+U" output, I can see it only when I select "Inspect element" in the browser. The HTML which was added manually operates the same items as usual, but I need AJAX-retrieved HTML to be working as well. I suspect I need to perform some 'append' method via JavaScript or jQuery, but I don't know how to do it in a proper way. Thanks.

    Read the article

  • Get Raw HTML of Node in JQuery

    - by viatropos
    I have used $("#parent").html() to get the inner html of #parent, but how do I get the html of the parent itself? The use case is, I grab an input node like this: var field = $('input'); I would like to be able to get the raw html of that node (<input type='text'>) with something like field.html(), but that returns empty. Is this possible?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >