Search Results

Search found 29484 results on 1180 pages for 'html'.

Page 25/1180 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Lazy HTML attributes wrapping in Internet Explorer

    - by AGS777
    Having encountered this Internet Explorer (all versions) behavior several times previously, I eventually decided to share this most probably useless knowledge. Excuse my lengthy explanations because I am going to show the behavior along with a very simple case when one can come across it inadvertently. Let's say I want to implement some simple templating solution in JavaScript. I wrote an HTML template with an intention to bind data to it on the client side: Please note, that name of the “sys-template” class is just a coincidence. I do not use any ASP.NET AJAX code in this simple example. As you can see we need to replace placeholders (property name wrapped with curly braces) with actual data. Also, as you can see, many of the placeholders are situated within attribute values and it is where the danger lies. I am going to use <a /> element HTML as a template and replace each placeholder pattern with respective properties’ values with a little bit of jQuery like this: You can find complete code along with the contextFormat() method definition at the end of the post. Let’s assume that value for the name property (that we want to put in the title attribute) of the first data item is “first tooltip”. So it consists of two words. When the replacement occurred, title attribute should contain the “first tooltip” text which we are going to see as a tooltip for the <a /> element. But let’s run the sample code in Internet Explorer and check it out. What you’ll see is that only the first word of the supposed “title” attribute’s content is shown. So, were is the rest of my attribute and what happened? The answer is obvious once you see the result of jQuery(“.sys-template”).html() line for the given HTML markup. In IE you’ll get the following <A id={id} class={cssClass} title={name} href="{source}" myAttr="{attr}">Link to {source}</A> See any difference between this HTML and the one shown earlier? No? Then look carefully. While the original HTML of the <a /> element is well-formed and all the attributes are correctly quoted, when you take the same HTML back in Internet Explorer (it doesn’t matter whether you use html() method from jQuery library or IE’s innerHTML directly), you lose attributes’ quotes for some of the attributes. Then, after replacement, we’ll get following HTML for our first data item. I marked the attribute value in question with italic: <A id=1 class=first title=first tooltip href="first.html" myAttr="firstAttr">Link to first.html</A> Now you can easily imagine for yourself what happens when this HTML is inserted into the document and why we do not see the second (and any subsequent words if any) of our title attribute in the tooltip. There are still two important things to note. The first one (and it actually the reason why I named the post “lazy wrapping” is that if value of the HTML attribute does contains spaces in the original HTML, then it WILL be wrapped with quotation marks. For example, if I wrote following on my page (note the trailing space for the title attribute value) <a href="{source}" title="{name}  " id="{id}" myAttr="{attr}" class="{cssClass}">Link to {source}</a> then I would have my placeholder quoted correctly and the result of the replacement would render as expected: The second important thing to note is that there are exceptions for the lazy attributes wrapping rule in IE. As you can see href attribute value did not contain spaces exactly as all the other attributes with placeholders, but it was still returned correctly quoted Custom attribute myAttr is also quoted correctly when returned back from document, though its placeholder value does not contain spaces either. Now, on account of the highly unlikely probability that you found this information useful and need a solution to the problem the aforementioned behavior introduces for Internet Explorer browser, I can suggest a simple workaround – manually quote the mischievous attributes prior the placeholder pattern is replaced. Using the code of contextFormat() method shown below, you would need to add following line right before the return statement: result = result.replace(/=({([^}]+)})/g, '="$1"'); Below please find original sample code:

    Read the article

  • HTML: Nesting DIVs problem

    - by mawg
    I am coding a form generator. So far, so good, then I decided to give it a real test. I made a form with some nested each holding a few controls. I will post the HTML at the end. If you load it into a browser, it renders, but is obviously wrong. I had previously tested using the W3C validator and things were fine, but that was for non nested. When I validate a form with nested I get errors: Error Line 13, Column 117: document type does not allow element "DIV" here …style="position: absolute; top:88px; left: 256px; width: 145px; height: 21px;"> So, how do I correct that? What do I do with nested FIELDSETs? Here's the complete HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title></title> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> </head> <body> <form action="C:\temp\an_elogger_test.php" method="get"><div class="TGroupBox" id="GroupBox1"> <fieldset style="position: absolute; top:24px; left:24px; width: 449px; height: 473px;"> <legend>GroupBox1</legend> <div class="TPanel" id="Panel1"> <fieldset style="position: absolute; top:64px; left:64px; width: 361px; height: 217px;"> <div class="TComboBox" id="ComboBox1" style="position: absolute; top:88px; left: 256px; width: 145px; height: 21px;"> <select name="ComboBox1"> </select> </div> <div class="TGroupBox" id="GroupBox2"> <fieldset style="position: absolute; top:80px; left:88px; width: 145px; height: 177px;"> <legend>GroupBox2</legend> <div class="TCheckBox" id="CheckBox1" style="position: absolute; top:112px; left: 104px; width: 97px; height: 17px;">CheckBox1<input type="checkbox" name="CheckBox1" value="CheckBox1Checked"></div> <div class="TCheckBox" id="CheckBox2" style="position: absolute; top:152px; left: 112px; width: 97px; height: 17px;">CheckBox2<input type="checkbox" name="CheckBox2" value="CheckBox2Checked"checked="checked"></div> </fieldset> </div> <div class="TRadioGroup" id="RadioGroup2"> <fieldset style="position: absolute; top:128px; left: 264px; width: 145px; height: 137px;"><legend>RadioGroup2</legend> eins: <input type="radio" name="RadioGroup2" value="eins" checked><br> zwei: <input type="radio" name="RadioGroup2" value="zwei"><br> drei: <input type="radio" name="RadioGroup2" value="drei"><br> </fieldset> </div> </fieldset> </div> <div class="TMemo" id="Memo1"><textarea name="Memo1" rows="8" cols="13" style="position: absolute; top:320px; left: 88px; width: 185px; height: 89px;"> </textarea> </div> <div class="TComboBox" id="ComboBox2" style="position: absolute; top:328px; left: 296px; width: 145px; height: 21px;"> <select name="ComboBox2"> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> <option value="d" selected="selected">d</option> <option value="e">e</option> </select> </div> </fieldset> </div> <div class="TPanel" id="Panel2"> <fieldset style="position: absolute; top:32px; left:520px; width: 425px; height: 449px;"> <div class="TPanel" id="Panel3"> <fieldset style="position: absolute; top:64px; left:552px; width: 345px; height: 185px;"> <div class="TMemo" id="Memo2"><textarea name="Memo2" rows="8" cols="13" style="position: absolute; top:88px; left: 584px; width: 185px; height: 89px;"> You may wish to leave this memo emptyOr perpahaps give instructions aboout what should be written here</textarea> </div> <div class="TEdit" id="Edit1" style="position: absolute; top:200px; left: 600px; width: 121px; height: 21px;"><input type="text" name="Edit1"value="Insert text here"></div> </fieldset> </div> <div class="TGroupBox" id="GroupBox3"> <fieldset style="position: absolute; top:272px; left:552px; width: 345px; height: 185px;"> <legend>GroupBox3</legend> <div class="TPanel" id="Panel4"> <fieldset style="position: absolute; top:304px; left:584px; width: 177px; height: 137px;"> <div class="TRadioGroup" id="RadioGroup1"> <fieldset style="position: absolute; top:312px; left: 600px; width: 97px; height: 105px;"><legend>RadioGroup1</legend> one: <input type="radio" name="RadioGroup1" value="one"><br> two: <input type="radio" name="RadioGroup1" value="two" checked><br> three: <input type="radio" name="RadioGroup1" value="three"><br> </fieldset> </div> </fieldset> </div> <div class="TEdit" id="Edit2" style="position: absolute; top:320px; left: 776px; width: 105px; height: 21px;"><input type="text" name="Edit2"></div> </fieldset> </div> </fieldset> </div> <div align="center" style="margin: auto"><input type="submit" name="submitButton" value="Submit" style="position:absolute;top:522px;"></div> </form> </body> </html>

    Read the article

  • Using beautifulsoup to extract text between line breaks (e.g. <br /> tags)

    - by Michael Altman
    I have the following HTML that is within a larger document <br /> Important Text 1 <br /> <br /> Not Important Text <br /> Important Text 2 <br /> Important Text 3 <br /> <br /> Non Important Text <br /> Important Text 4 <br /> I'm currently using BeautifulSoup to obtain other elements within the HTML, but I have not been able to find a way to get the important lines of text between <br /> tags. I can isolate and navigate to each of the <br /> elements, but can't find a way to get the text in between. Any help would be greatly appreciated. Thanks.

    Read the article

  • centering ul so that columns will be centered too

    - by user1815176
    In my page I want it so that when you resize the page past the point of the pictures, that the pictures will go into another row, all the way so each picture has it's own row. And then potentially I won't need any media queries. But unfortunaltely I can't find a way to center. I have tried everything I can think of, aside of making hundreds of media queries with different positioning. I can't make it a block because then it won't go into rows, I have tried margin: 0 auto;. I have tried changing the padding, I have even tried using the html align="center". Nothing is working. Here is the website http://spencedesign.netau.net/singaporehome.html Also I have a minor issue, sorry to croud this with two questions. But when it is in it's mobile state, there is no 10px padding at the bottom, and the singapore title is on the left side rather than floating. Here is my code <html> <head> <title> Singapore - Home </title> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <meta name="viewport" content="width=device-width, initial scale=1.0"> <style> * { margin: 0; padding: 0; } body { background: url('woodbackground.jpg'); background-size: cover; min-height: 100%; min-width: 100%; position: relative; top: 0; bottom: 0; left: 0; right: 0; } #container { width: 90%; margin: 0 auto; } h1 { font: bold 65px Helvetica, Arial, Sans-serif; text-align: center; color: #eee; position: relative; top: 60px; } h3 { font: 25px Helvetica, Arial, Sans-serif; text-align: center; color: #eee; position: relative; top: 80px; } ul#gallery { list-style: none; display: inline; margin: 0 auto; position: relative; top: 175px; width: 1300px; } ul#gallery li a { float: left; padding: 10px 10px 25px 10px; background-color: #eee; border: 1px solid #fff; -moz-box-shadow: 0px 2px 15px #333; position: relative; margin: 10px; text-decoration: none; } ul#gallery li a:hover { position: relative; top: -15px; } ul#gallery li a img { height: 150px; width: 250px; max-width: 100%; } ul#gallery li a p { margin-top: 25px; text-align: center; color: #000; font: Helvetica, Arial, Sans-serif; text-decoration: none; font-size: 20px; } @media screen and (max-width: 640px)    { ul#gallery {   left: 2.2%;   width: 600px; }   ul#gallery li a:hover {   top: 0px; } } </style> <body> <div id="container"> <h1> Singapore </h1> <h3><i> Singapore is the worlds first machine that works </i>- Lee Kuan Yew </h3> <ul id="gallery"> <li><a href="#"> <img src="gallery.jpg" alt="gallery" /> <p> Gallery </p> </a></li> <li><a href="#"> <img src="facts.jpg" alt="facts" /> <p> Facts </p></a></li> <li><a href="#"> <img src="tour.jpg" alt="tour" /> <p> Tour </p></a></li> <li><a href="#"> <img src="author.jpg" alt="author" /> <p> Author </p> </a></li> </ul> <br/> </div><!-- Container --> </body> <html> Thanks!

    Read the article

  • Decode HTML entities in android

    - by johboh
    Hi there. I need to decode HTML entities, e.g. from &#246; to ö, and &amp; to &. URLEncoder.decode(str) does not do the job (convert from % notations). TextUtils has a HTMLencode, but not a HTMLdecode. Are there any function for decoding HTML entities? Regards, Johan

    Read the article

  • How convert html to BBcode in C#

    - by Dmitriy
    Hello! I need to convert html text into bbcodes. Where i can find how should i do this? For example, I convert links: regex = new Regex("<a href=\"(.+?)\">(.+?)</a>"); htmlCode = regex.Replace(htmlCode, "[URL]$1[/URL]"); How can i convert all html tags in bbcodes (and replace to empty which isn't bb codes, tag P

    Read the article

  • Need Java Swing HTML canvas with support for integrated swing controls

    - by Iggy Ma
    I would like to create an application in swing in the style of web 2.0 but have the power and functionality of a thick client. I know substance and some other look and feels help with this some, but I was wondering if there is a way I can actually use some kind of html panel / canvas to create the content in html, embedding swing controls in the rendering so as to still use listeners and get the functionality. Anybody know of a way to do this?

    Read the article

  • Objective-C: How to replace HTML entities?

    - by arielcamus
    Hi, I'm getting text from Internet and it contains html entities (i.e. &oacute; = ó). I want to show this text into a custom iPhone cell. I've tried to use a UIWebView into my custom cell but I prefer to use a multiline UILabel. The problem is I can't find any way of replacing these HTML entities.

    Read the article

  • Dynamically populating an ExtJS HTML editor

    - by sean.mcgary
    So Im using ExtJS for a job Im working and Im trying to dynamically populate the textarea associated with the HTML editor with data based on what a user selects from a combo box. From what Ive found, I can load the HTML editor with text using the defaultValue property. So if Im going to populate it after the page loads, can I give it something like a datastore or is there a method I can call to set the text?

    Read the article

  • Netbeans render unrecognized files as html

    - by nick
    Hey Everyone, I am using Netbeans and very happy with it. Unfortunately I am having a little problem with it that I cant seem to figure out. I am using Silverstripe CMS and it uses a templating system that syntactically is basically just a mix of php and html. These files however end in .ss and therefore netbeans doesnt format and highlight them at all. How do I make netbeans format and highlight all .ss files just as if they where normal html files? Kind Regards Nick

    Read the article

  • Display HTML in an Actionscript 3 project

    - by Marcus Blankenship
    Folks, I am pulling all my Flash (pure AS3 project, not Flash CS3) content from a Drupal back-end for SEO purposes. This works great, except the HTML rendering built into the TextField object leaves a lot to be desired. Could anyone recommend any libraries that would allow me to display HTML elements? At this stage, commercial or open-source libraries are welcome. Thanks, Marcus

    Read the article

  • Styling the "html" element in CSS?

    - by Maushu
    Can anyone explain to me why can we style the element html? What are differences between it and body? I usually see tutorials and multiple websites using body and never html, I only found about it when using YUI 3: CSS Reset since changing the background in body didn't work.

    Read the article

  • Using HTML/CSS for UI in XNA?

    - by Rosarch
    Is there any way to use HTML/CSS to do the user interface for a XNA game? I would need to programmatically be able to update the HTML, as well as handle events. Or is there another framework I should be using? This thread looks promising: http://stackoverflow.com/questions/909671/ui-library-for-xna Also, whatever I use has to work on the Xbox 360.

    Read the article

  • CSS Background-Images Loading after HTML Images (Involves Javascript)

    - by Kevin C.
    I threw together a quick little microsite that you can see at http://monterraauction.com. If you don't have a super-fast connection (and nothing's cached), the very last items to load are the background-images that are used for CSS image-text replacement (primarily, that h1#head at the top, with a 7kb background image). Nothing debilitating, but it looks slightly awkward. And I'm asking this question as a matter of curiosity more than anything else ;) Also, please note that this occurs in Firefox, but not Chrome. Now, underneath the h1#head I have a jquery.cycle.lite-powered slideshow in div#photo. In the HTML markup there are a total of 13, heavy image files that make up each of the slides. If I remove all but the first slide, then the problem goes away! So the CSS background-images are loading after...those HTML images are done? But here's what's confusing: I check it out in YSlow...the CSS background-images have a much lower response time than all of the slides in #photo. Right after all the JS files finish loading, in fact. So why aren't they showing up first? I tried $('#photo img:last-child').load(function() { alert('Locked and Loaded!')});, but the background-images pop up a while before the alert does, so I'm assuming it's not waiting until the last slide has loaded (admittedly I'm a bit of JS noob so maybe I'm just making a wrong assumption). I also tried commenting out all the jquery.cycle.lite stuff, so that I knew I didn't have any JS manipulating the DOM elements in #photo, but that wasn't the problem. I tried putting all the JS at the bottom of the document, right before </body>, but that didn't work. Lastly, I tried turning off javascript, and of course the css background-image loads way before the images in #photo, so it's definitely a JS thing (amirite?) I guess the obvious solution here is to mark the slides up as LINKS rather than IMGs, and have Javascript insert those 12 extra slideshow images after the DOM is ready--users without javascript shouldn't need to download the extra images anyways. But again, I'm curious: Why does removing the extra HTML images from within #photo solve the problem? And why are the CSS background-images showing up after the HTML images have loaded, even though YSlow says the css background-images loaded first? Seeing as how it happens in FF but not Chrome, is it simply a browser issue? I appreciate any insight you guys could give me!

    Read the article

  • asp.net controls vs html element security?

    - by Eyla
    In general, If I have a choice when developing a web site to use html elements or asp.net controls which one is better to use if my website is interactive with server side operations such as accessing database. Is it more secure to use asp.net controls or does not matter. On other words, is it more secure to use asp.net controls instead of html element to deliver data or receive data from/to server side or no differences?

    Read the article

  • RegEx strip html tags problem

    - by Aleksandar Mirilovic
    Hi, I've tried to strip html tags using regex replace with pattern "<[^]*" from word generated html that looks like this: <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=iso-8859-2"> <meta name=Generator content="Microsoft Word 11 (filtered medium)"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place" downloadurl="http://www.5iantlavalamp.com/"/> <!--[if !mso]> <style> st1\:*{behavior:url(#default#ieooui) } </style> <![endif]--> <style> <!-- /* Font Definitions / @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} / Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal; font-family:Arial; color:windowtext;} span.EmailStyle18 {mso-style-type:personal-reply; font-family:Arial; color:navy;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style> </head> Everything works fine except for the bolded lines above, anybody got ideas how to match the them to? Thanks, Aleksandar

    Read the article

  • Convert tags to html entities

    - by Sarfraz
    Hello, Is it possible to convert html tags to html entities using javascript/jquery using any way possible such as regex or some other way. If yes, then how? Example: <div> should be converted to &lt;div&gt;

    Read the article

  • PHP parsing invalid html

    - by kmunky
    hi , i'm trying to parse some html that is not on my server $dom = new DOMDocument(); $dom->loadHTMLfile("http://www.some-site.org/page.aspx"); echo $dom->getElementById('his_id')->item(0); but php returns an error something like ID his_id already defined in http://www.some-site.org/page.aspx, line: 33. I think that is because DOMDocument is dealing with invalid html. So, how can i parse it even though is invalid?

    Read the article

  • python html generator

    - by Meloun
    I am looking for an easily implemented html generator for python. I found this one http://www.decalage.info/python/html but there is no way to add css elements (id, class) for table. thx

    Read the article

  • jQuery parent element inner HTML

    - by Anton
    I am getting inner HTML of element by next way: $(this).context.innerHTML Then I am getting parent inner HTML: $(this).parent().context.innerHTML But this code returns same values. Any ideas what is wrong?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >