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

    (@milindmore22)

    Hello @stevenbradley

    Thank you for contacting us, Can you please share the page where you implemented the amp-script?

    Thread Starter stevenbradley

    (@stevenbradley)

    Actually, after investigating it looks like the classic editor is the issue. When I add the code in the text view it is fine, but when I switch the tab to visual it must remove it because when I switch back to text view the code is gone.

    So classic editor is removing the code dynamically when the view is toggled between text and visual.

    Is there a working solution for this?

    Thread Starter stevenbradley

    (@stevenbradley)

    Also this is the code that is being removed by classic editor:

    <amp-script src=”https://example.com/my-script.js&#8221; width=”300″ height=”100″>
    <p>A single line of text</p>
    </amp-script>

    It’s leaving the paragraph element and removing the surrounding amp-script tag.

    Plugin Support Milind More

    (@milindmore22)

    Hello @stevenbradley

    Thank you for identifying the issue, as we mentioned in your previous support topic for amp-carousel classic editors is corrupting the amp tags and there is no solution for it.

    We will recommend adding amp-script using a WordPress hook based on the location where you want them.

    Thread Starter stevenbradley

    (@stevenbradley)

    Alright, thanks. I will look into how to hack the classic editor as that is the real issue at this point and is not really an AMP plugin problem as I originally thought.

    Plugin Support Milind More

    (@milindmore22)

    @stevenbradley 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 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Simple javascript using amp-script not working’ is closed to new replies.