SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2004
    Location
    Cincinnati, Ohio
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting an error when opening a pdf with window.open

    I'm trying to do something like this:

    onClick="window.open('mypdf.pdf');"

    This works fine in all browsers with Acrobat Reader 7. the problem is it's not working with IE and Adobe Reader v6.x (however the pdf can be read by v6.x if you open it manually)

    when you click the link in IE, it says "This type of file could harm your computer if it contains malicious code" and it wants you to open/save/cancel. If you hit open, it says file not found. Now I can get around this by using target="_blank", but then it gets blocked by the popup blocker.

    Any ideas?

  2. #2
    SitePoint Member
    Join Date
    Apr 2004
    Location
    Cincinnati, Ohio
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found a workaround

    onClick="window.open('loadPdf.html');"

    In loadPdf.html, just do a window.location.href='mypdf.pdf'


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •