browser-detection

Detect phone/tablet/web client using javascript

柔情痞子 提交于 2019-11-30 08:37:31
问题 I am trying to detect if the end user is on a phone, a tablet or a pc I have been Googling for a while, apparently there are no easy solution. Well I guess I should not use Resolution, since nowadays some tablets have amazing resolutions. I should not rely on orientation, because windows8 laptops can just rotate like tablets. (and responsive design is just too difficult for my current project) I've been trying to use UserAgent(thought it has its drawbacks too), but can not get it working,

ASP.NET Webforms Doesn't Render Postback JavaScript Function for Chrome/iOS

ε祈祈猫儿з 提交于 2019-11-30 07:18:37
When we supply the user agent Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X; en-us) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/21.0.1180.80 Mobile/9A405 Safari/7534.48.3 to our .NET 4 webforms app, the script that defines the function __doPostBack is not present on the page and thus nothing that uses it works. If we supply any other user agent string (say, Safari) it works fine. Can someone explain this? So the problem is that the Chrome user agent isn't recognized by .net and so it assumes that it's dealing with a low-level browser. To solve, we added ~/App_Browsers/CriOS.browser

Anti-aliased font in HTML page

老子叫甜甜 提交于 2019-11-30 05:14:02
问题 Is there a good way to create crisp, clear, LARGE font in webpages? I need to create a tag cloud effect on my homepage with different font sizes and colours. I've got it set up in HTML/CSS but on the older browsers or OS's which don't support anti-aliasing as default it looks a bit... crappy. I've played with sIFR, which worked beautifully but gave me some horrible load effects but I'm now wondering if there is a way to: a) do browser/OS detection to split users by browser/OS combinations

Is server-side user agent detection/sniffing bad?

我的未来我决定 提交于 2019-11-30 04:50:31
Client-side user agent detection is known to be bad and discouraged in favor of feature detection . However, is it also bad to react differently based on the incoming user agent field in a HTTP request ? An example would be sending smaller or larger images based on whether the incoming user agent is mobile or desktop. I think it depends what your motivation is. For example, in the mobile web sector what you are attempting to do is provide the user with something that looks sensible on their platform. Why be concerned about what user-agent the user is reporting, when it is purely for their own

The best browser detection solution in ASP.NET 4.0

淺唱寂寞╮ 提交于 2019-11-30 04:46:00
I googled this topic and I came across with three different ways to configure browser capabilities: browscap.ini, browserCaps element in web.config and .browser files in App_Browsers. I thought .browser files is the latest way, but I don't seem to find up-to-date files. But I found quite fresh browscap.ini from http://browsers.garykeith.com/downloads.asp . My first priority is to exclude common crawlers from the visitor stats. The second priority is to detect browser and os with correct versions (e.g. Opera 11 / Win7). Are there any libraries I could use? Is browscap.ini still a valid way and

How to determine if a Promise is supported by the browser

倾然丶 夕夏残阳落幕 提交于 2019-11-29 22:57:58
Does anyone know, using Modernizr or otherwise, if there is a way to detect if the Promise feature is enabled in a browser? I have a polyfill for the functionality, but only want to apply it if the browser does not have a native implementation. Update Dec 11 - 2016: All evergreen versions of browsers now support promises. They are safe to use. Update Nov 14 - 2016: Chrome, Firefox, Safari and IE all now have experimental support for promises in their dev channels. The specification has settled. I would still not rely on the implementation just yet and would use a library but this might change

Zepto fallback to jQuery

让人想犯罪 __ 提交于 2019-11-29 20:58:28
I'm using ZeptoJS for my web app, but I'd like to fall back to jQuery if the browser doesn't support Zepto. Since IE is the only major browser not supported at the moment, I'm tempted to detect IE: if(navigator.appName == 'Microsoft Internet Explorer'){ // load jquery } else { // load zepto } but I'd prefer to specificly detect Zepto support and use jQuery in other cases. Is there a feature detection way to do this? This might be a crazy idea (I'm not sure if Zepto will even load on an unsupported browser), but what about using Zepto's own browser detection to see if it's on an unsupported

ASP.NET Webforms Doesn't Render Postback JavaScript Function for Chrome/iOS

[亡魂溺海] 提交于 2019-11-29 09:18:39
问题 When we supply the user agent Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X; en-us) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/21.0.1180.80 Mobile/9A405 Safari/7534.48.3 to our .NET 4 webforms app, the script that defines the function __doPostBack is not present on the page and thus nothing that uses it works. If we supply any other user agent string (say, Safari) it works fine. Can someone explain this? 回答1: So the problem is that the Chrome user agent isn't recognized by .net

Identify IE9/IE10 using jQuery

只谈情不闲聊 提交于 2019-11-29 07:47:43
I have a jQuery code which is working fine for Chrome/Mozilla but not IE. if ($("html").hasClass("ie")) { $(function(){ $('.green-column, .red-column, .grey-column').click(function() { alert ($(this).attr("data-type")); }); }); } else { $(function(){ $('.green-column, .red-column, .grey-column').click(function() { $("<div title='Selected Task is:'>" + $(this).attr("data-type") + "</div>").dialog({ modal: true, resizable: false, buttons: [ { text: "OK", click: function() { $( this ).dialog( "close" ); } } ] }); }); }); } </script> <!--[if IE 7]> <html lang="en-us" class="ie"> <![endif]--> <!--

Detecting mobile browsers on the web?

*爱你&永不变心* 提交于 2019-11-29 05:06:46
I'm curious to know how to check for iPhone, iPad and other mobile browsers.(JavaScript or CSS) Edit: Not user agent string, please. That can be faked. Possible Dupes: Auto detect mobile browser (via user-agent?) and Standard way to detect mobile browsers in a web application based on the http request Basically you check the User Agent String see http://www.hand-interactive.com/resources/detect-mobile-javascript.htm Detect iPhone: navigator.userAgent.toLowerCase().search("iphone") > -1 In general feature detection is better than browser detection it is better to know what the user's browser