4
Hello, my problem is this, I have two Plugins with similar functions, however they cannot be loaded at the same time as errors occur.
Is there any way to load a particular script according to browser resolution?
Ex:
<script>
var largura = window.innerWidth;
if(largura > X){
//carregar plugin 1
//<script type="text/javascript" src="_js/plugin1.js"></script>
}
else{
//carregar plugin 1
//<script type="text/javascript" src="_js/plugin2.js"></script>
}
</script>
The way you put the question should work. Put more information about your code to be clearer. Then we can better understand.
– Samir Braga
It would be something like this, maybe it’s easier than I think, but I don’t know the right syntax. var width = window.innerWidth; if(width > X){ // would be this plugin /// <script type="text/javascript" src="_js/jquery.fullPage.js"></script> } Else{ //load plugin 2 }
– Vinícius