Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Resolved] onload open link

Home Forums Support [Resolved] onload open link

Home Forums Support onload open link

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1762654
    fabien

    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?

    #1762847
    Elvin
    Staff
    Customer Support

    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

    A wise man once said:
    "Have you cleared your cache?"

    #1762891
    fabien

    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.

    #1762917
    Elvin
    Staff
    Customer Support

    – 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.

    A wise man once said:
    "Have you cleared your cache?"

    #1764425
    fabien

    OK thank you πŸ™‚

    #1764510
    Elvin
    Staff
    Customer Support

    No problem. πŸ™‚

    A wise man once said:
    "Have you cleared your cache?"

    #1764519
    fabien

    .

    #1764639
    Elvin
    Staff
    Customer Support

    Feel free to open new topics if you need further help. Cheers! πŸ˜€

    A wise man once said:
    "Have you cleared your cache?"

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.