Here is EVERYTHING from my .js file :
function isMobile() {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};
Additionally, in my html, I have the following if else statements and included ONLY the following in my header:
<script type="text/javascript" src="function.js" ></script>
The if else in my html is as follows:
<script>
if( isMobile.any() ){
//load small video
}else{
//load full video
}
Now, I am a beginner. Can anyone tell me what might be wrong here? This is literally all the javascript related-ANYTHING in my code. Therefore if you know javascript, it might be obvious to you that something is missing, but don't assume that I have it and simply didn't add it to the post, because I don't. Like I said, this is literally everything. Any help?
Aucun commentaire:
Enregistrer un commentaire