Archived topic
onload open link
7 replies · Started by fabien on May 3, 2021
Hi there,
What is the easiest/most compatible way to open a URL onload a page?
I have an enquiry form that redirects to a thank you page upon submission. I'd like a brochure (link to a pdf) to trigger automatically when the thank you page opens (as I can't have 2 concurrent redirects upon submission of the form).
Could a JS hook on that page do the trick?
Hi there,
I'm not exactly sure what you mean.
To clarify: You want a brochure(that's a link) that pops up on the thank you page once it loads?
If so, you'll need a plugin for that.
Or do something like this:
https://codepen.io/rajrs/pen/dMowNx
To clarify:
- there is a form plugin
- upon submission of an enquiry > there is an auto redirect to /thank-you page (I need this URL to load for analytics to track lead conversions)
- I'd like to know if GeneratePress would allow for a hook to open /brochure.pdf automatically when {onLoad} /thank-you page.
– I’d like to know if GeneratePress would allow for a hook to open /brochure.pdf automatically when {onLoad} /thank-you page.
Hooks are simply for inserting HTML tags.
What you need is a script or plugin that actually pops up the HTML element that presents the PDF and another script or plugin to actually let the site embed the PDF to be made viewable within your page.
For the PDF viewer/embedder, you can use this - https://wordpress.org/plugins/pdf-embedder/
For the modal/pop-up functionality, you'll need a script like the codepen I've linked on my previous site and/or find a plugin that does that.
OK thank you :)
No problem. :)
.
Feel free to open new topics if you need further help. Cheers! :D