Solved

jQuery help needed

Posted on 2013-05-13
6
174 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
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 +…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now