Search Results

Search found 6478 results on 260 pages for 'hippy head'.

Page 60/260 | < Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >

  • innerHTML doesn't work correctly with xhtml in Chrome

    - by Desperadeus
    Hi! I've got a trouble with Chrome5.0.375.70, but FF 3.6.3 and Opera 10.53 are OK. Below is the line of code: document.getElementById('content').innerHTML = data.documentElement.innerHTML; The data object from the code is a document (typeof(data) == 'object') and I've got it by ajax request to chapter01.xhtml: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html [ <!ENTITY D "&#x2014;"> <!ENTITY o "&#x2018;"> <!ENTITY c "&#x2019;"> <!ENTITY O "&#x201C;"> <!ENTITY C "&#x201D;"> ]> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Alice's Adventures in Wonderland by Lewis Carroll. Chapter I: Down the Rabbit-Hole</title> <link rel="stylesheet" type="text/css" href="style.css"/> <link rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="page-template.xpgt"/> </head> <body> <div class="title_box"> <h2 class="chapnum">Chapter I</h2> <h2 class="chaptitle">Down the Rabbit-Hole</h2> <hr/> </div> The Chrome cuts all before body and as a result link to css in header is missed; user can't see formatted text and images. How can I fix it or bypass?

    Read the article

  • HTML5 tags not working at all in firefox 3.6.3

    - by William
    Okay, so I'm trying to get into this whole HTML 5 thing, and this tutorial (http://www.webreference.com/authoring/languages/html/HTML5/) says that these tags should move the content around without any kind of CSS at all, but all I'm getting is a line of text that looks like this: Header tag Nav tag Artical Section tags Aside tag footer tag Here is the code: <!DOCTYPE html> <html lang="en"> <head> <title>HTML5 test1</title> <meta charset="utf-8" /> </head> <body> <header> Header tag </header> <nav> Nav tag </nav> <article> <section> Artical Section tags </section> </article> <aside> Aside tag </aside> <footer> footer tag </footer> </body> </html>

    Read the article

  • problem on running script on different operating system

    - by Praveen kalal
    i run use a javascript code for getting browser information it run fine on microsoft windows xp but it not working on microsoft windows server 2003. my code is folowing. plz help. <html> <head> <script type="text/javascript" src="zeroclipboard/ZeroClipboard.js"></script> <script type="text/javascript"> window.onload = function F() { var today = new Date(); var the_date = new Date("December 31, 2012"); var the_cookie_date = the_date.toGMTString(); var the_cookie = screen.width +"x"+ screen.height; var the_cookie = "Screen Resolution:"+the_cookie + ";\nExpires:" + the_cookie_date+";\n Browser CodeName:"+navigator.appCodeName+";\n Browser Name: " + navigator.appName+";\n Browser Version: " + navigator.appVersion+";\n Browser Version: " + navigator.appVersion+"; \n Cookies Enabled: " + navigator.cookieEnabled +";\n Platform: " + navigator.platform+";\n User-agent header: " + navigator.userAgent; / document.getElementById('box-content').value=the_cookie; } </script> </head> <body> <textarea name="box-content" id="box-content" rows="10" cols="70"> </textarea> <br /><br /> <p><input type="button" id="copy" name="copy" value="Copy to Clipboard" /></p> </body> </html> <script type="text/javascript"> //set path ZeroClipboard.setMoviePath('http://192.168.101.135:471/browserinfo/zeroclipboard/ZeroClipboard.swf'); //create client var clip = new ZeroClipboard.Client(); //event clip.addEventListener('mousedown',function() { clip.setText(document.getElementById('box-content').value); }); clip.addEventListener('complete',function(client,text) { alert('text is copied'); }); //glue it to the button clip.glue('copy'); </script>

    Read the article

  • How can I enable child inputs text selection in Mozilla Firefox using CSS?

    - by L. Shaydariv
    Hi. Let consider the following scenario. I have the following page where all rendered elements must be non-selectable. <html> <head> <style type="text/css"> body { -webkit-user-select: none; -moz-user-select: none; } div { border: solid 1px green; padding: 5px; } </style> </head> <body> <div> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat </div> <div> <input type="text" value="You can select the text from me" /> <textarea> And me too. </textarea> </div> </body> </html> The input and textarea text is still selectable in Google Chrome, but the text is not selectable in Firefox. I've already tried the following: input, textarea { -moz-user-select: text !important; } And... It simply doesn't work because (as far as I can see) input and textarea are nested in the document body element that's already is not selectable. So, is it possible to enable text selection of the nested user input elements in Firefox using CSS? Thank you for suggestions.

    Read the article

  • onSubmit returning false is not working

    - by StuckOnSubmit
    I'm completely confused ... I'd swear this was working yesterday ... I woke up this morning and all my forms stopped to work in my project. All the forms have a "onsubmit" to a function that returns false since it's an ajax call, so the form is never sent. After a lot of tests, I simplified the question to this piece of code: <html> <head> <script type="text/javascript"> function sub() { alert ("MIC!"); return false; } </script> </head> <body> <form method = "post" id = "form1" onsubmit = "return sub()"> input: <input type="text" name="input1" > <a href="#" onClick="document.getElementById('form1').submit();">button</a> </form> </body> </html> I would swear that this works perfectly, but today is nor working :D Why if I press the button the form is sent ? I know it's a total newbie question, but I'm stuck Thank you !

    Read the article

  • Client Web Browser Behavior When Handling 301 Redirect

    - by Jon Swanson
    The RFC seems to suggest that the client should permanently cache the response: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 10.3.2 301 Moved Permanently The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible. This response is cacheable unless indicated otherwise. The new permanent URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s). If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. Note: When automatically redirecting a POST request after receiving a 301 status code, some existing HTTP/1.0 user agents will erroneously change it into a GET request. I'm having a hard time finding concrete browser documentation for any major browser that states how they handle these. I've started digging through the source code of firefox, but quickly got lost. Is the following scenario true for which (if any) browsers, and is there definitive documentation for either Firefox or IE that states as much?: First Time Around: 1.1: User enters link to site A, or clicks on a link directed at Site A 1.2: Browser interprets link at Site A, first time, no cache. Sends GET to Site A. 1.2: Site A responds with 301 Redirect to Site B 1.3: Browser sends GET to Site B. Any Subsequent Times Around: 2.2: User clicks on a link directed at Site A 2.2: Browser sees that, due to a past 301 redirect, Site A should now be Site B. 2.3: Without initiating any request whatsoever at Site A, browser initiates GET at Site B.

    Read the article

  • Why is the label not changing color using RegisterClientScriptBlock?

    - by Xaisoft
    I have an aspx page defined as follows: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" language='javascript'> function changecolor() { var lbl = document.getElementById('lblDisplayDate'); lbl.style.color = 'red'; }; </script> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="lblDisplayDate" runat="server" Text="Label"></asp:Label><br /> <asp:Button ID="btnPostBack2" runat="server" Text="Register Client Block Script" onclick="btnPostBack2_Click" /> </div> </form> Here is the btnPostBack2 Click event: protected void btnPostBack2_Click(object sender, EventArgs e) { if (!ClientScript.IsClientScriptBlockRegistered("JSScriptBlock")) { ClientScript.RegisterClientScriptBlock(this.GetType(), "JSScriptBlock", "changecolor();", true); } } Even though, I put the script in a function to change the color, it is still not doing it and why do I need to add the script tags to true if the function is already enclosed in script tags? lblDisplayDate is in the Page Load where it is set to the current time on every page reload.

    Read the article

  • Mac vs. Windows Browser Font Height Rendering Issue

    - by cdmckay
    I'm using a custom font and the @font-face tag. In Windows, everything looks great, regardless of whether it's Firefox, Chrome, or IE. On Mac, it's a different story. For some reason, the Mac font renderer thinks the font is a lot shorter than it is. For example, consider this test code (live example here): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Webble</title> <style type="text/css"> @font-face { font-family: "Bubbleboy 2"; src: url("bubbleboy-2.ttf") format('truetype'); } body { font-family: "Bubbleboy 2"; font-size: 30px; } div { background-color: maroon; color: yellow; height: 100px; line-height: 100px; } </style> </head> <body> <div>The quick brown fox jumped over the lazy dog.</div> </body> </html> Open it on Windows Firefox and on Mac Firefox. Use your mouse to select it. On Windows, you'll notice it fully selects the font. On Mac, it only selects about half the font. If you look at what it is selecting, you'll see that that part has been centered, instead of the full height of the font. Is there anyway to fix this rather large discrepancy?

    Read the article

  • Interrupting Prototype handler, alert() vs event.stop()

    - by lxs
    Here's the test page I'm using. This version works fine, forwarding to #success: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head> <script type="text/javascript" src="prototype.js"></script> </head><body> <form id='form' method='POST' action='#fail'> <button id='button'>Oh my giddy aunt!</button> <script type="text/javascript"> var fn = function() { $('form').action = "#success"; $('form').submit(); } $('button').observe('mousedown', fn); </script> </form> </body></html> If I empty the handler: var fn = function() { } The form is submitted, but of course we are sent to #fail this time. With an alert in the handler: var fn = function() { alert("omg!"); } The form is not submitted. This is awfully curious. With event.stop(), which is supposed to prevent the browser taking the default action: var fn = function(event) { event.stop(); } We are sent to #fail. So alert() is more effective at preventing a submission than event.stop(). What gives? I'm using Firefox 3.6.3 and Prototype 1.6.0.3. This behaviour also appears in Prototype 1.6.1.

    Read the article

  • 'Stack level too deep' error in engine-like plugin with globalize

    - by nutsmuggler
    Hello folks. I have built an engine-like plugin thanks to the new features of Rails 2.3. It's a 'Product' module for a CMS, extrapolated from a previously existing (and working) model/controller. The plugin relies on easy_fckeditor and on globalize (description and title field are localised), and I suspect that globalized could be the culprit here... Everything works fine, except for the update action. I get the following error message: (posting just the first lines, all the message is about attribute_methods) stack level too deep /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:64:in `generated_methods?' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:241:in `method_missing' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:249:in `method_missing' For referenze, the full error stack is here: http://pastie.org/596546 I've tried to debug eliminating all the input fields, one by one, but I keep getting the error. fckeditor doesn't seem the culprit (error even without fckeditor) This is the action: def update params[:product][:term_ids] ||= [] @product = Product.find(params[:id]) respond_to do |format| if @product.update_attributes(params[:product]) flash[:notice] = t(:Product_was_successfully_updated) format.html { redirect_to products_path } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @product.errors, :status => :unprocessable_entity } end end end As you see it's quite straightforward. Of course I am not hoping someone to solve this question straightaway, I'd just like to have a head up, a suggestion about where to look to solve this issue. Thanks in advance, Davide

    Read the article

  • Chrome is leaking memory, when jQuery is used on events?

    - by user269386
    Hi, I'm experiencing an increase of memory usage, when I use the jQuery-eventhandling in Chrome. I've tested it with IE and FF as well, but there I couldn't see a suspicious rise of memory-usage, compared to Chrome. I'm using Chrome version 4.0.223.16 (unfortunately I'm forced to use this version, here) Simple example here. Just scroll with the mousewheel in the red box and open the Chrome-taskmanager and you will see an increase of memory which won't be released anymore: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript" src="js/libs/jquery-1.4.2.min.js"></script> <script type="text/javascript"> jQuery(function () { jQuery("#div1").bind("mousewheel", function (event) { event.preventDefault(); }); }); </script> </head> <body> <div id="div1" style="width: 100px; height: 100px; background-color: red;"></div> </body> </html> Does anyone have experienced the same problem (or is it maybe solvend with a different version of chrome)? And does anyone have a fix for it? thanks

    Read the article

  • Android WebView viewport

    - by alex2k8
    With html below I expected that the green rectangle would occupy only half of the screen, but on practice it occupies the whole screen width. I tried other values for viewport width, no luck. Any ideas why it does not work? Html <html> <head> <meta name="viewport" content="width=640" /> </head> <body> <div style="width: 300px; height: 50px; background: green;">300px</div> <div style="width: 600px; height: 50px; background: yellow;">600px</div> </body> </html> Xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <WebView android:id="@+id/web_view" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout>

    Read the article

  • Problem with my Jquery loading in my Codeigniter views

    - by sico87
    Hello, I am working on a one page website that allows the users to add and remove pages from there navigation as and when they would like too, the way it works is that if the click 'Blog' on the main nav a 'Blog' section should appear on the page, if they then click 'News' the 'News' section should also be visible, however the way I have started to implement this it seems I can only have one section at a time, can my code be adpated to allow multiple sections to shown on the main page. Here is my code for the page that has the main menu and the users selections on it. <!DOCTYPE html> <head> <title>Development Site</title> <link rel="stylesheet" href="/media/css/reset.css" media="screen"/> <link rel="stylesheet" href="/media/css/generic.css" media="screen"/> <script type="text/javascript" src="/media/javascript/jquery-ui/js/jquery.js"></script> <script type="text/javascript" src="/media/javascript/jquery-ui/development-bundle/ui/ui.core.js"></script> <script type="text/javascript" src="/media/javascript/jquery-ui/development-bundle/ui/ui.accordion.js"></script> <script type="text/javascript"> $(document).ready(function() { $('a.menuitem').click(function() { var link = $(this), url = link.attr("href"); $("#content_pane").load(url); return false; // prevent default link-behavior }); }); </script> </head> <body> <li><a class="menuitem" href="inspiration">Inspiration</a></li> <li><a class="menuitem" href="blog">Blog</a></li> <div id="content_pane"> </div> </body> </html>

    Read the article

  • Qtip is not working for me?

    - by vinoth
    This is my coding for Qtip.But it wont be work .I dont know why? <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Qtip</title> <script type="text/javascript" src="/jquery demos/jquery1.4.2.js"></script> <script type="text/javascript" src="jquery.qtip-1.0.0-rc3.js"></script> <script> $(document).ready(function() { // Match all link elements with href attributes within the content div $("#content a[href]").qtip({ content: 'This is an active list element', show: 'mouseover', hide: 'mouseout' }); }); </script> </head> <body> <a href='#' id="content" class="qtip">sdfsfsd</a> </body> </html> Thanks in advance?

    Read the article

  • If I do "jquery sortable" on a contenteditable item(s), I then can't focus mouse anywhere inside con

    - by Matej
    Strangely this is broken only in Firefox and Opera (IE, Chrome and Safari works as it should). Any suggestion for a quick fix? <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $('#sortable').sortable(); }); </script> </head> <body> <span id="sortable"> <p contenteditable="true">One apple</p> <p>Two pears</p> <p>Three oranges</p> </span> </body> </html>

    Read the article

  • jquery noob problem with variables (scope?)

    - by aharon
    I'm trying to retrieve data from a php file named return that just contains <?php echo 'here is a string'; ?> I'm doing this through an html file containing <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script> var x; $.get("return.php", function(data){ x = data; }) function showAlert() {alert(x);} $(document).ready(function(){ alert(x); }); </script> </head> <body> <input type = "button" value = "Click here" onClick="showAlert();"> </body> </html> When the button is clicked it retrieves and displays the code fine, but on the $(document).ready thing, it displays "undefined" instead of the data in return.php. Any solutions? Thanks.

    Read the article

  • how to make the red div don't alert 'ss' when drag the black div on it ,

    - by zjm1126
    i using jquery and jquery-ui, this is my code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="viewport" content="width=device-width, user-scalable=no"> </head> <body> <style type="text/css" media="screen"> </style> <div id=a style="width:300px;height:300px;background:blue;position:absolute;"></div> <div id=b style="width:100px;height:100px;background:red;position:absolute;"></div> <div id=c style="width:50px;height:50px;background:black;clear:both"></div> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> $("#c").draggable({}); $("#b").droppable('disable');//this is not useful $("#a").droppable({ drop: function(event,ui) { alert('ss') } }); </script> </body> </html>

    Read the article

  • jQuery Swapping Elements

    - by zuk1
    Ok let me make an example: <head> <script type="text/javascript"> $(document).ready(function(){ $("#options_2").hide(); $("#options_3").hide(); }); </script> </head> <body> <div id="options_1">option 1</div> <div id="options_2">option 2</div> <div id="options_3">option 3</div> <a href="" class="selected">choose option 1</a> <a href="">choose option 2</a> <a href="">choose option 3</a> </body> As you can see only option 1 is visible by default, and the link you click to show option 1 has the class="selected" by default, showing the user that that option is currently selected. I basically want it so that when they click "choose option 2" the options 1 div hides itself and the options 2 div shows itself, and then gives the second link the selected class and removes the class from the image link. It basically just tabs using links and divs but due to the format I have to display it in I cannot use any of the tabs plugins I have found online.

    Read the article

  • Play youtube video in full screen ?

    - by Madhup
    Hi all, First of all sorry, If somebody finds this question is repeated (haven't found any by myself). I am developing for an iPad application and trying to play youtube videos using this code: NSString *embedHTML = @"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: transparent;\ color: white;\ }\ </style>\ </head><body style=\"margin:0\">\ <embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \ width=\"%0.0f\" height=\"%0.0f\"></embed>\ </body></html>"; NSString *html = [NSString stringWithFormat:embedHTML, youTubeUrl, 142.0, 129.5]; [wbView loadHTMLString:html baseURL:nil]; The code works fine when used in an iphone application (i.e. you touch on the webview and it starts playing the youtube video in fullscreen.) But when used in the iPad, on clicking the web view it starts playing the video in the web view itself and shows options to go to full screen, while I want to start the playback in the full screen from the beginning, like it does in the iPhone. Anybody having some ideas or people who have done it before please help. Thanks, Madhup

    Read the article

  • What's the best way to learn .NET?

    - by duffymo
    I've been developing Java EE for quite a while now. I've used WebLogic, Tomcat, Spring, and Hibernate extensively, so I have a mental model of what features are available and how things are developed and deployed. The problem that I have with .NET is that I don't have a clear mapping of its features onto Java EE. Here's what I know so far: Java EE - .NET Java - C# JAR - DLL WAR - ? (deployment in general) EAR - ? (deployment in general) Tomcat - IIS web server JSP - ASP? JDBC - ODBC JMS - MSMQ JTA - Microsoft Transaction Manager So much of the functionality that WebLogic handles appears to be dispersed throughout the Windows OS. My confusion kicks in when I see the waves of books at Borders - VB.NET, ASP.NET, C#, etc. If I'm not a VB programmer, would it be possible to stick with C# and write enterprise apps that are the equivalent of what I'm used to with Java EE? If there were a Top Three list of books to learn from, what would they be? The "Head First" series has certainly been successful for Java. http://www.amazon.com/Head-First-C-Brain-Friendly-Guides/dp/0596514824/ref=sr_1_1?ie=UTF8&s=books&qid=1224121193&sr=8-1 Equally well recommended for .NET learning? Thanks. - %

    Read the article

  • putting <%=yield %> in a partial for ajax jquery calls

    - by odpogn
    I'm trying to make the "home" link in my <%= render 'layouts/header' %> do an ajax/jquery call to change the <%= yield %> in a partial inside my content div. all i get are blanks in the view.. <%= yield %> works fine when put in a partial without ajax, but it doesn't display anything when using ajax... can yield not be used this way? all I'm really looking for is the ability to click on my sites navigation links without having to reload the entire page... my application.html.erb file looks like so: <head> $(function() { $("#home").live("click", function() { $.get(this.href, null, null, "script"); return false; }); }); </head> <body> <div id="container"> <%= render 'layouts/header' %> <div id="content"> <%= render 'layouts/content' %> </div> <%= render 'layouts/footer' %> </div> </body> my <%= render 'layouts/header' %> contains: <%= link_to "Home", root_path, :id => "home" %> my <%= render 'layouts/content' %> only contains: <%= yield %> home.js.erb $("#content").html("<%= escape_javascript(render("layouts/content")) %>");

    Read the article

  • Facebook like button issue.

    - by Ross Hale
    Hello community, We're having some trouble getting our like button to work. It seemed to work last week but suddenly it's stopped working. Basically when clicking "Like", we get an error saying: You failed to provide a valid list of administators. You need to supply the administors using either a "fb:app_id" meta tag, or using a "fb:admins" meta tag to specify a comma-delimited list of Facebook users. Our section looks like this: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en"> <head> <meta property="fb:app_id" content="number"/> <meta property="fb:admins" content="number"/> <meta property="og:title" content="title"/> <meta property="og:type" content="website"/> <meta property="og:url" content="url with trailing slash"/> <meta property="og:image" content="url to image"/> <meta property="og:site_name" content="Site Name"/> </head> Help?

    Read the article

  • Javascript: "Dangling" Reference to DOM element?

    - by Channel72
    It seems that in Javascript, if you have a reference to some DOM element, and then modify the DOM by adding additional elements to document.body, your DOM reference becomes invalidated. Consider the following code: <html> <head> <script type = "text/javascript"> function work() { var foo = document.getElementById("foo"); alert(foo == document.getElementById("foo")); document.body.innerHTML += "<div>blah blah</div>"; alert(foo == document.getElementById("foo")); } </script> </head> <body> <div id = "foo" onclick='work()'>Foo</div> </body> </html> When you click on the DIV, this alerts "true", and then "false." So in other words, after modifying document.body, the reference to the DIV element is no longer valid. This behavior is the same on Firefox and MSIE. Some questions: Why does this occur? Is this behavior specified by the ECMAScript standard, or is this a browser-specific issue? Note: there's another question posted on stackoverflow that seems to be referring to the same issue, but neither the question nor the answers are very clear.

    Read the article

  • ObjectiveFlickr - how to call getSizes on a photo ID not known until the response?

    - by Jonathan Cohen
    Hi guys, I'm building a free music instrument iPhone app with the Flickr API and ObjectiveFlickr.A random photo from the interestingness list is displayed in the background, but I can't center it without knowing its size. (so I can reset the UIWebView frame) I've been researching this for awhile, and if the answer is super easy, please have some mercy on a noob - it's my first time playing with a web service API. =) Since I don't know the photo ID until after I receive the response from the interestingness feed, how would I call flickr.photo.getSizes on the response? This is what I have so far: - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary{ int randomResponse = arc4random() % 49; photoDict = [[inResponseDictionary valueForKeyPath:@"photos.photo"] objectAtIndex:randomResponse]; NSString *photoID = [photoDict valueForKeyPath:@"id"]; NSLog(@"%@",photoID); NSURL *photoURL = [flickrContext photoSourceURLFromDictionary:photoDict size:OFFlickrMediumSize]; NSString *htmlSource = [NSString stringWithFormat: @"<html>" @"<head>" @" <style>body { margin: 0; padding: 0; } </style>" @"</head>" @"<body>" @"<img src=\"%@\" />" @"</body>" @"</html>" , photoURL]; [webView loadHTMLString:htmlSource baseURL:nil]; }

    Read the article

  • Jquery problem - cant expand the row above in a table

    - by apg1985
    Hi People, What I cant figure out is how I would toggle a row in a table using the one below it. So say I have a table with 2 rows the first contains content and the one below contains a button, when the page loads the content row is hidden and when you click the button it toggles the content row on and off. In the example the first table works but the second does not, I need the second one to work. <!DOCTYPE HTML> <html> <head> <title>Testing Horizontal Accordion</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".sectionhead").toggle( function() { $(this).next("tr").hide(); }, function() { $(this).next("tr").show(); } ) }); </script> </head> <body> <table> <tr class="sectionhead"><td></td></tr> <tr class="child"><td>child</td></tr> </table> <br> <table> <tr class="child"><td>child</td></tr> <tr class="sectionhead"><td></td></tr> </table> </body> </html>

    Read the article

< Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >