-1

https://stackoverflow.com/a/34902833/14773450

In this answer, would I be right in assuming that if I wanted to load a certain script ONLY for (say) iPhone, then I could delete some of the entries within isMobile()?

i.e. :

function isMobile() {
   return (/iPhone/i.test(navigator.userAgent));
}
Justin
  • 1

1 Answers1

0

Yes that would be correct because the code is still syntactically correct and it would rule out all other devices like androids

Da Mahdi03
  • 1,468
  • 1
  • 9
  • 18