In term of the innerHTML function working in Internet Explorer version 6 and 7, but that function had some problems run on Firefox 3.
According to Microsoft MSDN document shows the syntax (object.innerHTML = ‘ <b> Hello World</b>’) of the innerHTML is correct under IE7. The “object” could be the HTML element Div, Span, Label and such. It worked on IE7.
But this syntax “object.innerHTML = ‘<b> Hello World</b>’” doesn’t work on Firefox 3. An error message shows at JavaScript Console on Firefox is “object is undefined”.
On the Net, someone also had the similar problem with innerHTML property. An Example 1 that somebody used the title “Problems with innerHTML property” posted on a forum. Example 2, someone used the title “innerHTML not working in Firefox” on other forum.
The solution also been posted on a forum as Example 3. The solution on solving the innerHTML property problem is change the syntax on “document.getElementById("object").innerHTML="<b>Hello World </b> "” which can run on IE7 and Firefox 3.
I am not sure other guys solving their problem yet or not. In my case, the problem has been fixed.
No comments:
Post a Comment