rasolomon has asked for the wisdom of the Perl Monks concerning the following question:

I do apologize that this is not a Perl question. However you guys are really helpful and knowledgeable, so here goes.

I use a script to download a PDF document onto the browser. There are links in the PDF document that go to various HTML webpages.

The problem is when I am in IE, I have to press the back button twice to get back to the PDF.

This does not happen in Firefox.

Is there a way to write a script that will enable me to get back to the PDF with only 1 press of the BACK button?

I am writing the website in PHP, however a Perl solution will be more than welcome too ;)

Thank you and keep up the good work!

Robert

  • Comment on (OT) Have to press BACK button twice in IE to get back from an HTML page to a PDF!

Replies are listed 'Best First'.
Re: (OT) Have to press BACK button twice in IE to get back from an HTML page to a PDF!
by marcussen (Pilgrim) on Aug 01, 2008 at 04:29 UTC

    Usually when I experienced that behavior from IE there would be a redirect involved. So link in PDF takes you to intermittent location which then redirects to the final location. This may or may not be the case here.

    Additionally it is hard to rule out environmental factors, such as which pdf reader do you use, what version of ie, pdfreader, etc. Do you have proxies, do they strip or add headers to your requests. Do you have spyware that could be hijacking links, do you have kill bits set for activex objects or javascript in pdfs, etc. If you can ensure us that it is reproducible behavior it might be easier to check using some inspection tools (such as etheral or something similar).

    Confucius says kill mosquito unless cannon
      I typically cover this by actually opening the PDF in a new window. You can use JavaScript to do this, and have a noscript tag to cover the case where the user has javascript disabled (for accessibility). TIP: Use "target='_blank'" in your link, and it'll open in a new window.....
      -- $world =~ s/war/peace/ig;
Re: (OT) Have to press BACK button twice in IE to get back from an HTML page to a PDF!
by Lawliet (Curate) on Aug 01, 2008 at 02:25 UTC

    First of all, if it is an off-topic thread, please prepend (Is prepend even a word? Think append to the beginning) "OT" to the title to signify it's off-topicness. Second of all, why use IE?

    Regarding the actual issue at hand, I would say it is possible. A quick fix would be to have a link on the website go back two pages (this, of course, would not change the user having to press back twice if they use the back button on their browser. Also, it would be annoying to Firefox users).

    Update: I may be misunderstanding your question. Do you mean to apply a solution that you use on your site, or a solution to apply to the browser?

    <(^.^-<) <(-^.^<) <(-^.^-)> (>^.^-)> (>-^.^)>
      Sorry, have OT'ed the subject.

      OK, I use Firefox, but most of our clients use IE, so we have to keep them happy

      I guess I want the solution to apply to the browser. I want to have this solution work if the user is

    • using Internet Explorer and
    • coming from the PDF

      Cheers again! RS