jQuery help needed

I'm inexperienced with jQuery or javascript, and am trying to implement a plug-in which is described at http://www.jquery4u.com/mobile/detect-mobile-devices-jquery/    My test page, at http://mauitradewinds.com/MobileDetect/test.htm , is supposed to return an appropriate alert, as to whether or not a mobile device is accessing the page.  Unfortunately, the alert always says that a mobile device is in use, whether or not it is.  Please advise me how to correct this.

BTW, I'm aware there are many other alternatives for detecting mobile browsers, but I would appreciate the chance to evaluate this particular one, starting with correcting my code.
ddantesAsked:
Who is Participating?
 
leakim971PluritechnicianCommented:
check this test page : http://jsfiddle.net/3jeMe/
0
 
ddantesAuthor Commented:
Perfect.  What was wrong with the code I was using?
0
 
leakim971PluritechnicianCommented:
it was setting a variable in it's own prison
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
ddantesAuthor Commented:
Just for clarification, was that an issue with the javascript, or the way I invoked it on the htm page?
0
 
leakim971PluritechnicianCommented:
with the javascript AND the way you invoked it on the htm page

should be : window.check
and if(window.check)
and put FIRST <script src="jquery.min.js"></script>
and after any relative plugin (but nor problem, you're not using jQuery in the plugin...)
0
 
ddantesAuthor Commented:
Thank you.  I wish I had your knowledge, but failing that, it's great to have your assistance.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.