Link to home
Start Free TrialLog in
Avatar of Larkdog
LarkdogFlag for United States of America

asked on

Coding Help HTML ->JS->PDF

I have a website that I am building to benefit students in my school district.  I write the pages by hand in HTML and PHP.  I have a few Perl scripts worked in the mix too.  I'm no expert, but know a lot more than the common Joe.  My menu is created using AllWebMenus Lite version and seems to be javascript.  I have  a menu link that loads a PDF file.  I need an alert box to popup with a disclaimer prior to the pdf file loading.  How would this be done?
ASKER CERTIFIED SOLUTION
Avatar of Mike_Carroll
Mike_Carroll
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Larkdog

ASKER

something like the following?

menu link to a page that has only two items; 1] the alert, and 2] meta refresh=0

and the meta refresh redirects to the pdf.  that's pretty simple.  i must have just had a brain fart or something.  or i was trying to make it too hard.

lol... ro just use window.location = "http://www.mysite.com/this_is_my_pdf.pdf"
when you get control back after the alert()
Avatar of LiknoSoftware
LiknoSoftware

Hello,

We are afraid the above solution is the only one that would work for the LITE version.

If you get AllWebMenus PRO however, you are allowed to add JavaScript code directly to the menu item.

With this, you can show an alert box (or even confirmation box) while still in the same page, and then redirect to the next only if the user wants to.

You can do so, by adding the following code to the JavaScript code property of the onclick state of your item:

if (confirm("Do you want to show the pdf?")) window.location = "http://www.mysite.com/mypdf.pdf";

or if you want an alert, just:

alert("You will now see a pdf."); window.location = "http://www.mysite.com/mypdf.pdf";
Avatar of Larkdog

ASKER

interesting finding Likno Software here at Experts-exchange.  Using the alert is the best option for my case b/c it allows me to put a disclaimer up before the person proceeds.  I do like Likno though!  Its the easiest thing I've found so far.
We are here to help - if anything please do not hesitate to contact us (you can also do so directly at support [AT] likno [DOT] com.