Solutions
Create a function to load the javascript
function loadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.text = "var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date()";
script.src = "https://embed.tawk.to/54cfadabb37d8bc7b1a9863f/default";
script.charset = "UTF-8";
script.setAttribute("crossorigin", "*");
script.async = true;
document.body.appendChild(script);
}
When page load than check the window.innerWidth that if its greater than 600 then call the loadScript()
$(document).ready(function () {
if (window.innerWidth > 600) {
loadScript();
}
});
Create a function to load the javascript
function loadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.text = "var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date()";
script.src = "https://embed.tawk.to/54cfadabb37d8bc7b1a9863f/default";
script.charset = "UTF-8";
script.setAttribute("crossorigin", "*");
script.async = true;
document.body.appendChild(script);
}
When page load than check the window.innerWidth that if its greater than 600 then call the loadScript()
$(document).ready(function () {
if (window.innerWidth > 600) {
loadScript();
}
});
0
