• Resolved biznext

    (@biznext)


    Hi,

    I added a JS code my to post with window.open – but it doesn’t work on amp pages.

    How to add the same option on the amp page?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @biznext

    Thank you for the support topic, AMP does not allow custom javascript so the AMP plugin removes them to create Valid AMP pages.

    AMP does allow custom javascript using amp-script component but it has Limited DOM support (Window.open() is not supported) as an amp-script run script in a Worker DOM.

    We will recommend adding links with target attribute taget="_blank"

    Hope this helps!

    Thread Starter biznext

    (@biznext)

    I know but sometimes I need a window open.

    I saw a <amp-social-share> – I think it something maybe a solution.
    it is not a simple link, but some button with open new window.

    But I don’t know how to setup it.
    Maybe you have an idea how to use this in more simple guide (even if there is a code customization) ?

    Plugin Support Milind More

    (@milindmore22)

    Hello @biznext

    The amp-social-share component can be used for social sharing, if you are looking to add social sharing button you can use plugins such as WordPress Share Buttons Plugin – AddThis

    You can also use Jetpack plugin to add a social sharing button.

    Can you please share your AMP page URL so we can check and understand your requirement and assist you with the proper solution?

    Plugin Support Milind More

    (@milindmore22)

    @biznext
    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Open link like window.opn JS’ is closed to new replies.