469,325 Members | 1,467 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,325 developers. It's quick & easy.

issue with document.writeln

Hi,
I want to open a image in new window from one tool.
In IE7 window.open giving Access Denied error.
So, I have used following code

Expand|Select|Wrap|Line Numbers
  1. function newWindow() {
  2. var msg='<html><body><form><img src="2500_TV_Stereo.jpg" /></form></body></html>\n';
  3. var win = open('','',params); 
  4. win.document.writeln(msg); 
  5. win.document.close(); 
  6.  
this is not showing image, but when I am using
background-image:url(2500_TV_Stereo.jpg);
it is coming, but when I am trying to print, it is not printing because it is a background image.
I want to print background image or I want to image to be displayed
Can any one please help me out.
Thanks in advance
Sep 22 '09 #1
4 2610
acoder
16,027 Expert Mod 8TB
Why not create a page with the image or was it this that was causing the access denied error? Post the code that you used for window.open().
Sep 23 '09 #2
Acoder,
Thanks for your reply
I have used following window.open
Expand|Select|Wrap|Line Numbers
  1. window.open ("C:/Program Files/2500_TV_Stereo.jpg","mywindow","menubar=1,resizable=1,width=350,height=250"); 
It is giving Access denied error.

Thanks
Sep 23 '09 #3
Plater
7,872 Expert 4TB
Well there's your problem, IE7 no doubt as the securty setting disallowing access to "local" files (its under the zone management)
Sep 23 '09 #4
acoder
16,027 Expert Mod 8TB
A simple solution would be to access the image relatively, not with an absolute path:
Expand|Select|Wrap|Line Numbers
  1. window.open ("2500_TV_Stereo.jpg"...
Sep 28 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Gary Mayor | last post: by
5 posts views Thread by George Hester | last post: by
2 posts views Thread by Christopher Benson-Manica | last post: by
3 posts views Thread by JCCDevel | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.