Hello,
I am working with Shoptet, which is something similar to Shopify. I am allowed to add JavaScript and CSS, but I am not allowed to modify the back-end.
I am trying to load the “Hodnocení obchodu” part from https://www.bio-krasa.cz/hodnoceni-obchodu/ - it should be .content-inner - and display it on the front page.
I added the following to the head:
<script>
$(document).ready(function(){
$('#hodnoceni-obchodu').load('/hodnoceni-obchodu .content-inner'); //tried without the front slash too
});
</script>
and I created a HTML banner for the front page which contains:
<div id="hodnoceni-obchodu">
</div>
However, the div is empty. Can you please point me in a direction, what am I doing wrong? Thank you very much.
Thank you. The page I am trying to display it on is the main page - https://www.bio-krasa.cz - so there should be no issue with the same origin policy.
It has been suggested to me that it is better to select the element based on the ID, not class, since ID is unique, unlike class. So i changed it to: $('#hodnoceni-obchodu').load('/hodnoceni-obchodu #content');
but still no luck, the div is still empty. I guess I select in a not enough specific way somehow.
Thanks
Thank you very much, this was indeed the case. I moved my code from towards the end of the tag and it works now. (Not sure why this has changed in Shoptet, it used to be different before. I remember using a lot if instertAfter and similar stuff in the in Shoptet before.)