dcsimg
document.write not working in IE
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Joe_C
Posted On:   Sunday, July 23, 2006 07:40 PM

Hello. I created a bookmarklet that includes an external js file and displays output on a page using document.write. It works in FireFox but nothing happens when I use it in IE and I am not sure why. Here is the code for the bookmarklet: javascript:(function(){with(j=(d=document).createElement(s='script')){type='text/'+(language='java'+s);src='http://www.mysite.com/test.js';}d.body.appendChild(j);})() and the code in the js page I am calling document.write('Hello'); void(document.close()) If I changed it to an alert box the message would display but for some reason I cant get it to work when using the document.write command. Any help would be greatly appreciated. Thx    More>>

Hello. I created a bookmarklet that includes an external js file and displays output on a page using document.write. It works in FireFox but nothing happens when I use it in IE and I am not sure why. Here is the code for the bookmarklet:

javascript:(function(){with(j=(d=document).createElement(s='script')){type='text/'+(language='java'+s);src='http://www.mysite.com/test.js';}d.body.appendChild(j);})()

and the code in the js page I am calling

document.write('Hello');
void(document.close())

If I changed it to an alert box the message would display but for some reason I cant get it to work when using the document.write command. Any help would be greatly appreciated. Thx

   <<Less

Re: document.write not working in IE

Posted By:   Firat_Tiryaki  
Posted On:   Tuesday, July 25, 2006 10:07 AM

Explorer gets "javascript:" as a protocol and can not write... It writes to document object but you cannot see it.


Maybe javascript:void(bla bla...) will work.
For more help send your all code, or tell exactly what you want to do...

About | Sitemap | Contact