Solved

jQuery help needed

Posted on 2013-05-13
6
186 Views
Last Modified: 2013-05-13
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.
0
Comment
Question by:ddantes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 250 total points
ID: 39163530
check this test page : http://jsfiddle.net/3jeMe/
0
 

Author Comment

by:ddantes
ID: 39163558
Perfect.  What was wrong with the code I was using?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39163559
it was setting a variable in it's own prison
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ddantes
ID: 39163562
Just for clarification, was that an issue with the javascript, or the way I invoked it on the htm page?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39163564
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
 

Author Comment

by:ddantes
ID: 39163578
Thank you.  I wish I had your knowledge, but failing that, it's great to have your assistance.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question