I haven't checked with IE9 but I have a simple JS that utilizes document.write to display some information. It works on every browser except IE 6, 7, 8. I checked all my other code and when I decided to eliminate all of it and simply put
document.write(Testing);
I got nothing from IE. Is there another mand I can use. I am new to Javascript.
I haven't checked with IE9 but I have a simple JS that utilizes document.write to display some information. It works on every browser except IE 6, 7, 8. I checked all my other code and when I decided to eliminate all of it and simply put
document.write(Testing);
I got nothing from IE. Is there another mand I can use. I am new to Javascript.
Share Improve this question asked Mar 25, 2011 at 19:40 smulholland2smulholland2 1,1632 gold badges14 silver badges29 bronze badges 3- 1 Not an answer.. but it sounds like you may want to spend some quality time with jQuery... – Shane Courtrille Commented Mar 25, 2011 at 19:43
-
Add quotation marks around
Testing
and see what that does. – Blender Commented Mar 25, 2011 at 19:44 -
2
Testing
is an undefined variable. But you should not usedocument.write
anyway. Create a new DOM element instead. – Felix Kling Commented Mar 25, 2011 at 19:45
3 Answers
Reset to default 4I'm not sure how your original code is using document.write, but you could achieve more or less the same effect this way:
<div id="outputGoesHere"></div>
<script type="text/javascript">
document.getElementById("outputGoesHere").innerHTML = "Testing";
</script>
try: document.write('Testing');
We were having this problem earlier today and luckily our page already had access to jquery...
Replacing document.write(variableWithYourValue)
with $('html').html(variableWithYourValue)
did the trick for us.