Results 1 to 3 of 3
Thread: cross browser scripting question
Mar 15, 2004, 07:09 #1
cross browser scripting question
I have a script which needs to populate a html div with various things depenging on the paarameter supplied to the function. I have done this in the past with something like:-
fullOpHtml = "<p>Blah blah</p>";
which works with IE but I would also like this to work with Mozilla browsers.
I have looked at using document.getElementById("outp") but I don't seem to be able to do a .innerHTML on that.
This must be easy, whats the property/method I'm looking for? Preferably one method which would work for IE & MOzilla..
Any pointers much appreciated as ever!
Mar 15, 2004, 09:48 #2
I just sussed this out...
getelementbyid is the thing to use, however in Firefox, the DIV needs SOME content initially for this to work, and a "no-break-space" won't do it, it needs some actual text in there to start off with, otherwise Firefox just says "getelementbyid(thing) has no properties".
If I give it just some default text content like so <div id=helpcontent>Help</div> then it all works fine assuming the div is above the script... Weird...
Mar 15, 2004, 10:54 #3
- Join Date
- Dec 2002
- Alabama, USA
- 0 Post(s)
- 0 Thread(s)