• Resolved kleinefrage

    (@kleinefrage)


    Hello,

    i need an AMP-Javascript for my mentioned site https://heimarbeit-erfahrungen.com/jobs/ because on mobile devices it shows, that Java Script is missing and it cant show the jobs.

    On this mentioned site, it wouldnt even be a problem cause i could disable AMP there because its just a little site and loading also fast without amp.

    But i want to integrate the Jobs-Shortcode into my main site https://heimarbeit-erfahrungen.com/, and so i need an AMP-Javascript for the job-Area that i will implement in my main site. Because without this AMP-Javascript i will be forced to disable AMP on my main site.

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

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

    (@milindmore22)

    Hello @kleinefrage

    Thank you for the support topic, You can use the amp-script component to add javascript on your site it may require customizing your theme or plugin.

    amp-script runs your custom JavaScript in a Web Worker. so it has limited support you can however try using amp-script using this mini plugin.

    Alternatively, you can try enabling the experimental Sandboxing feature, This in effect allows you to have a page with all the benefits of the AMP runtime, but also with additional non-AMP scripts (javascript added by your site’s plugin or themes) you may need. The ultimate goal is to provide flexible AMP so your site can benefit from superior Page experience

    To enable Sandboxing feature, Switch to Standard Mode you will notice Sandboxing Panel will appear on AMP settings pages Enable sandboxing with
    Loose Mode in case you want to keep all custom javascript from your site.
    (screenshot)

    Hope this helps!

    Thread Starter kleinefrage

    (@kleinefrage)

    Hello,

    thanks for infos. I am trying first the solution with the mini plugin, because the second solution wouldnt be good for me cause i have transitional mode for Desktop (non AMP) and Mobile (AMP) and want to stay in non AMP for Desktop.

    I installed the mini plugin. But will it work here? Cause its a toggle plugin, but here is nothing to toggle. I just need the Javascript that the jobs are showed.

    I installed it and wanted to make this to run https://snipboard.io/i4dXzf.jpg on mobile: https://heimarbeit-erfahrungen.com/jobs/?amp=1

    I see the element is this <ul class=”job_listings”>
    and i put it like here https://snipboard.io/I6jlCu.jpg but the site still doesnt show the jobs.

    • This reply was modified 3 years, 2 months ago by kleinefrage.
    • This reply was modified 3 years, 2 months ago by kleinefrage.
    • This reply was modified 3 years, 2 months ago by kleinefrage.
    Plugin Support Milind More

    (@milindmore22)

    Hello @kleinefrage

    You can add JS in plugin settings Dashboard->AMP Compatibility->JS
    (screenshot)

    Remember you need to add javascript, jQuery won’t work.

    Similarly, you can add CSS using Dashboard->AMP Compatibility->CSS, no need to edit plugin files.

    Thread Starter kleinefrage

    (@kleinefrage)

    Hello Milind,

    i cant see your Screenshots on Lightshot. I tried all, signed in, downloaded lightshot. It doesnt work. There where the image should be is just a fail symbol.
    https://snipboard.io/UCHr32.jpg

    • This reply was modified 3 years, 2 months ago by kleinefrage.
    • This reply was modified 3 years, 2 months ago by kleinefrage.
    Plugin Support Milind More

    (@milindmore22)

    that’ strange here is image attached also https://snipboard.io/CpjtTF.jpg

    Thread Starter kleinefrage

    (@kleinefrage)

    Hello,

    i tried it https://snipboard.io/TkLUWV.jpg

    But it seems that it doesnt work. Also the sha-Code is changing every time i opening the AMP-Site again.

    “amp-script Script hash not found or incorrect for amp-script[script=”amp_compat_js”].js. You must include <meta name=”amp-script-src” content=”sha384-cMZA962YERBWmZCPNGqdQAzFmPmmEMzJ9zY2vsenlxOaU12kQ7BnU4tTwqdLFXxP”>. During development, you can disable this check by adding the “data-ampdevmode” attribute to amp-script[script=”amp_compat_js”].js, or the root html nodeSee”

    [amp-script] Uncaught SyntaxError: Unexpected token ‘<‘
    at (blob:https://heimarbeit-erfahrungen.com/68569499-3671-4254-abb1-21215f57ba81:3)

    • This reply was modified 3 years, 2 months ago by kleinefrage.
    • This reply was modified 3 years, 2 months ago by kleinefrage.
    Plugin Support Milind More

    (@milindmore22)

    @kleinefrage

    You need to enter only javascript in that (AMP Compatibility->JS) field do not add HTML, it even shows a warning on the left side of editor (check yellow dot), the plugin puts <amp-script> opening tag in the header and closing tag </amp-script> in the footer, so the form is already in amp-scrpit tag no need to add that element again.

    amp-script hash regenerates every time you make changes in code, and you don’t need to enter script hash if you logged in as administrator.

    If you are unsure of how to use the mini plugin I will recommend going with Sandboxing Option.

    Thread Starter kleinefrage

    (@kleinefrage)

    Thanks, i know now what to do. Now i need just the Javascript-Code from the normal non-AMP-Site of this area that doesnt work in amp. Then i paste the Java-Script in. I already asked in the wpjobmanager what the Javascript-Code for this area is and just waiting for answer there.

    • This reply was modified 3 years, 2 months ago by kleinefrage.
    Plugin Support Milind More

    (@milindmore22)

    ok, Please remember amp-scipts has limited API support For a complete list of supported DOM APIs, see the API compatibility table.

    alternatively please check out possibility of listing with AMP components such as amp-list

    Plugin Support Milind More

    (@milindmore22)

    @kleinefrage
    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 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Need AMP-Javascript’ is closed to new replies.