471,887 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

issue with document.writeln

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(); 
this is not showing image, but when I am using
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 2660
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
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.

Sep 23 '09 #3
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
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 zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.