|
March 3, 2000 Updating Inner HTML Tips: March 2000
Yehuda Shiran, Ph.D.
|
|
One of the classic incompatibilities between Internet Explorer and Netscape Navigator is the way they update DHTML elements. Internet Explorer supports the innerHTML property for several elements, including the SPAN and the DIV. Netscape Navigator, on the other hand, does not support the innerHTML property. The trick to overcome it is by writing to the document property of the DHTML element. The first problem in implementing such a write operation is that it does not work while loading the page. You have to write to the DHTML element only after the page is fully loaded. You can define an event handler, onload():
And start() just writes a welcome message to the phone display:
The other problem is that when you write to the DHTML in Netscape Navigator, you completely blank the other attributes of the DHTML, like its frame, its background color, etc. The solution we use here was to embrace a
In Internet Explorer, we just change the
Again, notice how Internet Explorer anchors on the inner
People who read this tip also read these tips: Look for similar tips by subject: |