issue with document.writeln

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nareshtatipelli
    New Member
    • Aug 2009
    • 4

    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

    Code:
    function newWindow() {
    var msg='<html><body><form><img src="2500_TV_Stereo.jpg" /></form></body></html>\n';
    var win = open('','',params); 
    win.document.writeln(msg); 
    win.document.close(); 
    }
    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
    Last edited by gits; Sep 23 '09, 03:17 AM. Reason: added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    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().

    Comment

    • nareshtatipelli
      New Member
      • Aug 2009
      • 4

      #3
      Acoder,
      Thanks for your reply
      I have used following window.open
      Code:
      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
      Last edited by gits; Sep 24 '09, 01:53 PM. Reason: added code tags

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well there's your problem, IE7 no doubt as the securty setting disallowing access to "local" files (its under the zone management)

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          A simple solution would be to access the image relatively, not with an absolute path:
          Code:
          window.open ("2500_TV_Stereo.jpg"...

          Comment

          Working...