[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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