House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  Javascript

Does the IE interpreter multitask?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi all,
Dan K
07/30/07 08:08 P
Remember that browsers interpret your html slightly different thus when
Bader, Terrence C CTR MARMC, 231
07/31/07 09:17 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dan K
07/30/2007 08:08 PM

Hi all, Forgive my unfamiliarity with IE's engine (or for that matter javascript), but I was hoping I could find some answers more easily here.  I am testing a web page with two browsers:  IE v7.0.5730 and Firefox v2.0.0.5, and (surprise!) IE is giving me grief.  Here is the code that my IE debugger claims is a runtime error (s is a string):   document.getElementById("Container").innerHTML += s; I am skeptical that this is the true source of the problem since a simple ammendment to a document object shouldn't throw off IE (this code works just fine in Firefox).   Interestingly, when I query as to the length of the element with id "Container" right before the above call:   alert(document.getElementById("Container").innerHTML.length); I invariably get two different numbers (13641 in IE, 13931 in FF).  The only time the innerHTML of this object is modified is when it is initialized, which is called in a function that precedes the function that has the runtime error script.  Heres to clarify:   addCategories(); /*function that defines the innerHTML of the object*/   addPrinciples(); /*function that ammends to the innerHTML and 'causes' the error*/   Could the error come from the order in which IE executes js?  Any speculation on this problem would be greatly appreciated!!!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bader, Terrence C CTR MARMC, 231
07/31/2007 09:17 AM

Remember that browsers interpret your html slightly different thus when you load a page what happens is that the html is formatted by that browsers engine.  Not knowing all the specifics you can imagine that they each have their own interpretation and format things differently. This is then what is used to determine the length of innerHtml and why you get different answers.  To test this you could write some code, load it and then post the innerHtml in both browsers and see what the different is. Have you tried doing this: var newText =  document.getElementById("Container").innerHTML + s; document.getElementById("Container").innerHTML = newText; ?? += should work but try it and see....   Also you cannot write to innerHTML while the document is still loading (use HTMLDocument.write()). So questions that remain are, what is all the code and what are you trying to do? ~Terry Hi all, Forgive my unfamiliarity with IE's engine (or for that matter javascript), but I was hoping I could find some answers more easily here.  I am testing a web page with two browsers:  IE v7.0.5730 and Firefox v2.0.0.5, and (surprise!) IE is giving me grief.  Here is the code that my IE debugger claims is a runtime error (s is a string):   document.getElementById("Container").innerHTML += s; I am skeptical that this is the true source of the problem since a simple ammendment to a document object shouldn't throw off IE (this code works just fine in Firefox).   Interestingly, when I query as to the length of the element with id "Container" right before the above call:   alert(document.getElementById("Container").innerHTML.length); I invariably get two different numbers (13641 in IE, 13931 in FF).  The only time the innerHTML of this object is modified is when it is initialized, which is called in a function that precedes the function that has the runtime error script.  Heres to clarify:   addCategories(); /*function that defines the innerHTML of the object*/   addPrinciples(); /*function that ammends to the innerHTML and 'causes' the error*/   Could the error come from the order in which IE executes js?  Any speculation on this problem would be greatly appreciated!!!


<< Previous Thread Today's Threads Next Thread >>

Search javascript

May 20, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference