473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 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 2812
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

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

Similar topics

by: Nat | last post by:
Hi I have following code: ----------------- protected override void Render(HtmlTextWriter w) { if (helpString!=null) { w.Write("<span class='tooltipiconouter'><img title =...
by: Gary Mayor | last post by:
Hi, I'm back again. Basically i'm trying to draw a box over an image which is turning out to be a nightmare. The problem i'm getting at the moment is that i'm creating a line with <div which works...
by: George Hester | last post by:
function spawn(ev){ var oSelect = ''; var oFlag = false; if (ns4 || ns6) oSelect = document.getSelection(); else if (ie4 || ie5){ if (!ev) ev = window.event; oFlag = true; oSelect =...
by: Eli | last post by:
I've got a script that I'm trying to debug which uses document.write() to place HTML within a page. In both IE6 and Firefox when I view source, I see only the script itself and not any HTML as...
by: Christopher Benson-Manica | last post by:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">...
by: Adam | last post by:
This is frustrating me. Opening IE displays the following code fine. When I open a new window the code no longer works. All the HTML is overwritten with the first document.write statement. Tried...
by: eels | last post by:
Hello, I want to open a new window with javascript: secondWindow=window.open(...) secondWindow.document.writeln(...) I wrote the javascript code into a separate file secondwindow.js. I...
by: JCCDevel | last post by:
Hi All, I'm not too proficient in Javascript but am trying to help a friend out. Bascially, the page we are having trouble with is loaded with a numerical value in the url string. Example: ...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.