CDATA and custom script js
in Other
hello,
i have this script to insert for my website
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css"/>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$(".reservation_popup").fancybox({
'width': 600,
'height': 630,
'type': 'iframe',
'zoomSpeedIn': 300,
'zoomSpeedOut': 300
});
});
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css"/>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$(".reservation_popup").fancybox({
'width': 600,
'height': 630,
'type': 'iframe',
'zoomSpeedIn': 300,
'zoomSpeedOut': 300
});
});
</script>
when i insert it in custom js by betheme option at bottom on every page i got white line with this //]]>
as you can see on this website for ex. https://le-sixiemesens.fr/
the developer of the script told me its because of CDATA tag not recognized by html folders (something like this don't understood everything ...)
and if i insert script directly in the footer.php this is delete after each update of theme
how can i do ?
ty
Comments
Notice!
Please attach a link to this forum discussion.
Thanks
1) You can't insert a <script> tag into Custom JS field, because it's already inside <script> tag.
So if you will insert it again, it won't work correctly.
2) I changed the <link rel> tag of fancybox to the other location.
It's in SEO > Google Analytics field - You can insert a custom CSS files there, you won't issue your theme, because it's only inserting code inside of <head>
Same with <script> location (but it's inside Google | Remarketing)