Solved

jQuery help needed

Posted on 2013-05-13
6
172 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

743 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

13 Experts available now in Live!

Get 1:1 Help Now