Solved

jQuery help needed

Posted on 2013-05-13
6
177 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
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…

772 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