• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

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?
0
Larkdog
Asked:
Larkdog
  • 2
  • 2
  • 2
1 Solution
 
Mike_CarrollCommented:
Pop up an alert box with the disclaimer and then modify the location of the current page to point at the pdf sounds like the easiest solution.
0
 
LarkdogAuthor Commented:
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.

0
 
Mike_CarrollCommented:
lol... ro just use window.location = "http://www.mysite.com/this_is_my_pdf.pdf"
when you get control back after the alert()
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
LiknoSoftwareCommented:
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";
0
 
LarkdogAuthor Commented:
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.
0
 
LiknoSoftwareCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now