tripadvisor widget
-
hi,
usually it's no problem to integrate scripts into LAY, but this one uses a URL as the function, which means it can't be wrapped in:
window.laytheme.on("newpageshown", function(layoutObj, type, obj){
});
can anyone help with this?
<div id="TA_certificateOfExcellence176" class="TA_certificateOfExcellence"><ul id="qyZP9Xq" class="TA_links uebl3Xmuf0G"><li id="47IvIet6" class="sjQ1Y8"><a target="_blank" href="https://www.tripadvisor.com/Attraction_Review-g187147-d7675416-Reviews-Parisitour-Paris_Ile_de_France.html"><img src="https://www.tripadvisor.com/img/cdsi/img2/awards/CoE2017_WidgetAsset-14348-2.png" alt="TripAdvisor" class="widCOEImg" id="CDSWIDCOELOGO"/></a></li></ul></div>
<script async src="https://www.jscache.com/wejs?wtype=certificateOfExcellence&uniq=176&locationId=7675416&lang=en_US&year=2019&display_version=2" data-loadtrk onload="this.loadtrk=true"></script>
-
Dear @dani
the code you are embedding with the link (https://www.jscache.com/wejs?wtype=certificateOfExcellence&uniq=176&locationId=7675416&lang=en_US&year=2019&display_version=2) is pretty short when opened.Maybe LAY cannot read it because it uses a different way of loading JS:
http://laytheme.com/documentation.html#custom-javascriptCan you rewrite it maybe?
Best!
Marius
-
I can't rewrite it because it comes from Trip Advisor.
I tried embedding the returned function like this:
<script>
window.laytheme.on("newpageshown", function(layoutObj, type, obj){(function(t,r,i,p){i=t.createElement(r);i.src="https://www.tripadvisor.com/WidgetEmbed-certificateOfExcellence?year=2019&locationId=7675416&display_version=2&uniq=176&lang=en_US";i.async=true;p=t.getElementsByTagName(r)[0];p.parentNode.insertBefore(i,p)})(document,"script");
});
</script>but doesn't work either.
-
Dear @dani
then we might not be able to use this widget.Is there a URL on Tripadvisor to which you can link to instead?
Best!
Marius
-
Dear @dani
we hope to release a PHP version of LayTheme. Then this will be possible :-DBest!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it