Jetheat Posted October 26, 2014 Share Posted October 26, 2014 I'm trying to detect a user's mobile handset when he visits my web page. So on my web page, I have placed this Javascript code: <html xmlns="XHTML namespace"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type='text/javascript' src="js/wurfl.js"> </script> <title>Untitled Document</title> </head> <body> <script type="text/javascript"> console.log(WURFL); document.write(WURFL.form_factor); </script> </body> </html> Inside the wurfl.js file, it says this: eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 2={"1":0,"4":"5 8 7","6":"9"};',10,10,'false|is_mobile|WURFL|var|complete_device_name|generic|form_factor|browser|web|Desktop'.split('|'),0,{})) When I visit the web page from my iPhone it simply outputs: "Desktop" instead of "iPhone".Any idea what could be wrong?ThanksJHPS: I dont know any javascript. Just asking for help on what I could change. Link to comment https://forums.phpfreaks.com/topic/292081-getting-handset-device-name/ Share on other sites More sharing options...
MDCode Posted October 26, 2014 Share Posted October 26, 2014 That js file has been minified. It's not in a readable format. Link to comment https://forums.phpfreaks.com/topic/292081-getting-handset-device-name/#findComment-1494857 Share on other sites More sharing options...
Jetheat Posted October 27, 2014 Author Share Posted October 27, 2014 That js file has been minified. It's not in a readable format. eval(function(p,a,c,k,e,d){e=function©{return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e©+'\\b','g'),k[c])}}return p}('3 2={"1":0,"4":"5 8 7","6":"9"};',10,10,'false|is_mobile|WURFL|var|complete_device_name|generic|form_factor|browser|web|Desktop'.split('|'),0,{})) Link to comment https://forums.phpfreaks.com/topic/292081-getting-handset-device-name/#findComment-1494886 Share on other sites More sharing options...
MDCode Posted October 27, 2014 Share Posted October 27, 2014 The JavaScript itself is minified. No matter how you post it here, it's not readable. Link to comment https://forums.phpfreaks.com/topic/292081-getting-handset-device-name/#findComment-1494906 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.