• Resolved Imagetudodemotos

    (@tudodemotos)


    Hello

    We are using the API from the following developer: https://www.tabelafipebrasil.com/api/

    The JavaScript used is as follows:

    It works perfectly, but obviously not in AMP format. Is there anything I can do to make it work?

    I appreciate any help.

    Reggards
    Dorival Jr

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support ImageMilind More

    (@milindmore22)

    Hello @tudodemotos

    Thank you for reaching out to us, The Fipe API uses a script to fetch and generate a form for it, the custom JavaScript is not allowed in AMP pages. However, you can embed the script using the amp-iframe tag.

    Please follow the below steps:

    1) Create a file in your website’s wp-content directory and call it fipe-table.html

    2) Open fipe-table.html and add the following code in it

    <script async src="https://www.tabelafipebrasil.com/api/js/tabelafipe-widget.min.js"></script> <div class="tfb-query" data-style="4" ></div>

    3) Now log in to the WordPress backend, open the page where you wanted it to embed, and add a custom HTML block.
    add following code in it

    <amp-iframe
      width="200"
      height="500"
      sandbox="allow-scripts"
      layout="responsive"
      frameborder="0"
      src="/wp-content/fipe-table.html"
    >
    </amp-iframe>

    You should be able to find it working in AMP pages. You can add similarly on widget pages.

    We hope this helps!

    Thread Starter Imagetudodemotos

    (@tudodemotos)

    It works!
    Thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.