Larkdog
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
lol... ro just use window.location = "http://www.mysite.com/this_is_my_pdf.pdf"
when you get control back after the alert()
when you get control back after the alert()
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";
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";
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.
ASKER
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.