List Info

Thread: Does the IE interpreter multitask?




Does the IE interpreter multitask?
user name
2007-07-30 12:20:42
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").innerHT
ML.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!!!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pu
b/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: http://www.houseoffusion.com/groups/Jav
ascript/message.cfm/messageid:4417
Subscription: http://www.houseoffusion.com/groups/Javascript/subsc
ribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/u
nsubscribe.cfm?user=22184.15789.33

RE: Does the IE interpreter multitask?
user name
2007-07-31 08:14:15
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


-----Original Message-----
From: Dan K [mailto:noler13hotmail.com] 
Sent: Monday, July 30, 2007 13:21
To: Javascript
Subject: Does the IE interpreter multitask?

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").innerHT
ML.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!!!



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RV
JP

Archive: http://www.houseoffusion.com/groups/Jav
ascript/message.cfm/messageid:4418
Subscription: http://www.houseoffusion.com/groups/Javascript/subsc
ribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/u
nsubscribe.cfm?user=22184.15789.33

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )