Looking for help with implementing two scripts that are specifically designed for different screen widths. Unfortunately, these scripts can only be tested on the actual domain they are intended for.
Here are the provided scripts:
For mobile:
<script>
(function(){
var t = document.getElementsByTagName("script")[0];
var s = document.createElement("script"); s.async = true;
s.src = "//integration.nfusionsolutions.biz/client/jh/widget/module/accordionchart/nfaccordion";
t.parentNode.insertBefore(s, t);
})();
</script>
For desktop:
<script>
(function(){
var t = document.getElementsByTagName("script")[0];
var s = document.createElement("script"); s.async = true;
s.src = "//integration.nfusionsolutions.biz/client/jh/widget/module/spottableextended/nfspotextended";
t.parentNode.insertBefore(s, t);
})();
</script>
I attempted to implement the desktop script but it seems like something is not quite right.
Updated code based on feedback:
<script>
if ($(window).width() > 990) {
(function(){
var t = document.getElementsByTagName("script")[0];
var s = document.createElement("script");
s.async = true;
s.src = "//integration.nfusionsolutions.biz/client/jackhunt/widget/module/spottableextended/nfspotextended";
t.parentNode.insertBefore(s, t);
})();
} else {
(function(){
var t = document.getElementsByTagName("script")[0];
var s = document.createElement("script");
s.async = true;
s.src = "//integration.nfusionsolutions.biz/client/jackhunt/widget/module/accordionchart/nfaccordion";
t.parentNode.insertBefore(s, t);
})();
}
</script>