admin管理员组文章数量:1326333
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.
本文标签: javascriptdocumentwrite in IEStack Overflow
版权声明:本文标题:javascript - document.write in IE - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742201778a2432095.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论