browser-detection

How to show different pages for different versions of IE [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-23 06:28:09
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Browser detection in javascript? I was wondering how can I detect IE 6, IE 7 and IE8 and say if any of these show different page instead of index. Something like update.html would be just fine. I have seen these IF IE6 and stuff but only for CSS not for index page. Thanks in advance. 回答1: Try this HTML code: <html> <body> <!--[if IE]> <script language="javascript"> document.location = "http://www.google.com/"; <

Target specific BlackBerry's with User Agent

不羁岁月 提交于 2019-12-21 21:44:17
问题 I found this javascript to detect blackberry devices: <script type="text/javascript"> var ua = navigator.userAgent; if (ua.indexOf("BlackBerry") >= 0) { if (ua.indexOf("Version/") >= 0) { // ***User Agent in BlackBerry 6 and BlackBerry 7 Verposition = ua.indexOf("Version/") + 8; TotLenght = ua.length; document.write("Jorgesys BB OS Version :: " + ua.substring(Verposition, Verposition + 3)); } else {// ***User Agent in BlackBerry Device Software 4.2 to 5.0 var SplitUA = ua.split("/"); document

How do I programmatically detect how a browser handles window.close()?

徘徊边缘 提交于 2019-12-21 07:47:00
问题 Different web browsers handle the window.close() function differently. IE prompts the user for confirmation, while Firefox and Safari just fail to honor it unless the window was originally opened with Javascript and display a message saying as much in the console. A third party web application used internally in our organization that I support displays a 'close' button at the end of a wizard-like series of pages. This works well for IE, which is what the majority of our users use. However,

JavaScript Detection / Browser Statistics

荒凉一梦 提交于 2019-12-21 07:37:26
问题 This has been asked few times but I think it's still worth checking with you guys for some more input. All my websites use Google Analytics for stats. Since it relies on JavaScript I thought it was important for me to check how many people actually have JS enabled in their browsers enabled/disabled. I remember I usually checked w3schools browser statistics, and recent results show something around 95% which was quite satisfactory for me. But since it applies purely on their website, I thought

Detect if website visitor has toolbars installed eg. Google toolbar using javascript

僤鯓⒐⒋嵵緔 提交于 2019-12-20 01:47:07
问题 I am working on an online education website that frequently uses pop up windows. This is part of a learning management system from a third party provider so not possible to change the way this works. We get lots of helpdesk calls with users stuggling with popup blockers - in their OS, browser settings and additional toolbars. I am using javascript to sniff browser and OS so we can display appropriate pop up blocker instructions onscreen. Is it possible to do similar technique to detect

Detect if website visitor has toolbars installed eg. Google toolbar using javascript

不想你离开。 提交于 2019-12-20 01:46:58
问题 I am working on an online education website that frequently uses pop up windows. This is part of a learning management system from a third party provider so not possible to change the way this works. We get lots of helpdesk calls with users stuggling with popup blockers - in their OS, browser settings and additional toolbars. I am using javascript to sniff browser and OS so we can display appropriate pop up blocker instructions onscreen. Is it possible to do similar technique to detect

Drupal 7 Browser specific css

时光毁灭记忆、已成空白 提交于 2019-12-18 18:04:13
问题 How can i have a browser specific css in Drupal 7 . I would like to load chrome.css if browser is chrome . Please help 回答1: You can do this in your template.php file with a preprocess_html theme hook and drupal_add_css function. You will find example in drupal 7 theme, for example in bartik : // Add conditional stylesheets for IE drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 7', '!IE' => FALSE), 'preprocess' => FALSE)); drupal

How to determine if a Promise is supported by the browser

我是研究僧i 提交于 2019-12-18 10:40:37
问题 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. 回答1: 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

jQuery - detecting the operating system and operating system version

时光毁灭记忆、已成空白 提交于 2019-12-17 17:59:10
问题 I have been writing a userscript for the past few months, for my company, and have just designed the main site for it with installation instructions (our employees are based all around the world and very few have heard of userscripts, let alone used them, so this frontend is meant to cut down the time I spend supporting the script). What I would like to do is, on the installation page, detect which browser and OS / OS version they're using so that I can highlight the most relevant

Detecting IE6 using jQuery.support

梦想的初衷 提交于 2019-12-17 17:27:05
问题 Anyone have any ideas on how to test for something specific for IE6 (and not IE7) using jquery.support? My problem is that IE6 supports :hover psuedo-class only for anchor elements and IE7 does support it for all elements (as FF, Chrome, etc). So I want to do something special in case the browser does not support :hover for all elements... thus I need a way to test for this feature. (don't want to use jQuery.browser). Any ideas? 回答1: While it's good practice to check for feature support