<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: jQuery browser and OS detection plugin</title>
	<atom:link href="/2009/07/16/jquery-browser-and-os-detection-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>/2009/07/16/jquery-browser-and-os-detection-plugin/</link>
	<description>on web development</description>
	<lastBuildDate>Fri, 26 Oct 2018 21:40:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>By: Trinity</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-318370</link>
		<dc:creator><![CDATA[Trinity]]></dc:creator>
		<pubDate>Sat, 23 May 2015 10:54:07 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-318370</guid>
		<description><![CDATA[Detected! Thank you for your script.]]></description>
		<content:encoded><![CDATA[<p>Detected! Thank you for your script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthon</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-49681</link>
		<dc:creator><![CDATA[Anthon]]></dc:creator>
		<pubDate>Wed, 09 Jul 2014 18:01:25 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-49681</guid>
		<description><![CDATA[Can you please be more explicit about &quot;which&quot; free or open source license this is being released/distributed under?  e.g., MIT, BSD-2-clause, etc]]></description>
		<content:encoded><![CDATA[<p>Can you please be more explicit about &#8220;which&#8221; free or open source license this is being released/distributed under?  e.g., MIT, BSD-2-clause, etc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick McCready</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-29352</link>
		<dc:creator><![CDATA[Nick McCready]]></dc:creator>
		<pubDate>Sat, 31 May 2014 19:42:05 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-29352</guid>
		<description><![CDATA[Anyway you can post the source and this project to your github space as repository? This way it can be used with bower,  node .. etc.]]></description>
		<content:encoded><![CDATA[<p>Anyway you can post the source and this project to your github space as repository? This way it can be used with bower,  node .. etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srdjan</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-20389</link>
		<dc:creator><![CDATA[Srdjan]]></dc:creator>
		<pubDate>Mon, 13 Jan 2014 23:42:32 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-20389</guid>
		<description><![CDATA[hey, just tried on windows 7 in IE 11 and it shows as mozilla. :(]]></description>
		<content:encoded><![CDATA[<p>hey, just tried on windows 7 in IE 11 and it shows as mozilla. 🙁</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-18577</link>
		<dc:creator><![CDATA[James]]></dc:creator>
		<pubDate>Mon, 01 Apr 2013 19:03:46 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-18577</guid>
		<description><![CDATA[Hi there, I am new to javascript but basically all I want to do is for mac, iphone, ipad show a button that says register and for windows show a button that says download - each with separate links.

So basically I am thinking:
&lt;code&gt;
if ($.client.os == &#039;Mac&#039;) {
      $(this).show(&quot;#register&quot;); $(this).hide(&quot;#download&quot;);
	  }

if ($.client.os == &#039;iPhone&#039;) {
      $(this).show(&quot;#register&quot;); $(this).hide(&quot;#download&quot;);
}

if ($.client.os == &#039;Windows&#039;) {
      $(this).show(&quot;#download&quot;); $(this).hide(&quot;#register&quot;);
}
&lt;/code&gt;

And within my html doc I have 2 buttons:
div id=&quot;download&quot; -  Button for Windows 
div id=&quot;register&quot; - Button for Mac 

Am I far off here?

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hi there, I am new to javascript but basically all I want to do is for mac, iphone, ipad show a button that says register and for windows show a button that says download &#8211; each with separate links.</p>
<p>So basically I am thinking:<br />
<code><br />
if ($.client.os == 'Mac') {<br />
      $(this).show("#register"); $(this).hide("#download");<br />
	  }</p>
<p>if ($.client.os == 'iPhone') {<br />
      $(this).show("#register"); $(this).hide("#download");<br />
}</p>
<p>if ($.client.os == 'Windows') {<br />
      $(this).show("#download"); $(this).hide("#register");<br />
}<br />
</code></p>
<p>And within my html doc I have 2 buttons:<br />
div id=&#8221;download&#8221; &#8211;  Button for Windows<br />
div id=&#8221;register&#8221; &#8211; Button for Mac </p>
<p>Am I far off here?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergio</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-18190</link>
		<dc:creator><![CDATA[Sergio]]></dc:creator>
		<pubDate>Thu, 17 Jan 2013 16:18:04 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-18190</guid>
		<description><![CDATA[Can you tell me how to detect an android operating system?]]></description>
		<content:encoded><![CDATA[<p>Can you tell me how to detect an android operating system?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoimen</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-18173</link>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
		<pubDate>Wed, 16 Jan 2013 09:06:08 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-18173</guid>
		<description><![CDATA[@Mark - thanks!]]></description>
		<content:encoded><![CDATA[<p>@Mark &#8211; thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-18102</link>
		<dc:creator><![CDATA[Mark]]></dc:creator>
		<pubDate>Tue, 08 Jan 2013 22:48:55 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-18102</guid>
		<description><![CDATA[Added OS versioning for Windows, Mac and Linux.  Tested on Win NT through Win 8, OS X 10.8, and Ubuntu.  I&#039;m sure it needs some additional testing but works for my needs as is.  

&lt;code&gt;
(function() {
	
	var BrowserDetect = {
		init: function () {
			this.browser = this.searchString(this.dataBrowser) &#124;&#124; &#039;Unknown&#039;;
			this.browserVersion = this.searchVersion(navigator.userAgent)
				&#124;&#124; this.searchVersion(navigator.appVersion)
				&#124;&#124; &quot;Unknown&quot;;
			this.os = this.searchString(this.dataOs) &#124;&#124; &#039;Unknown&#039;;
			this.osVersion = this.searchString(this.dataOsVersion) &#124;&#124; &#039;Unknown&#039;;
		},
		searchString: function (data) {
			for (var i=0;i&#060;data.length;i++)	{
				var dataIdentityRegExGroups = data[i].identityRegExGroups;
				var dataString = data[i].string;
				var dataProp = data[i].prop;
				this.versionSearchString = data[i].versionSearch &#124;&#124; data[i].identity;
				
				if(dataIdentityRegExGroups) {
					var matches = dataIdentityRegExGroups.exec(dataString);
					if(matches) { return matches[1]; }
				}
				else if (dataString) {
					if (dataString.indexOf(data[i].subString) != -1)
						return data[i].identity;
				}
				else if (dataProp)
					return data[i].identity;
			}
		},
		searchVersion: function (dataString) {
			var index = dataString.indexOf(this.versionSearchString);
			if (index == -1) return;
			return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
		},
		dataBrowser: [
			{
				string: navigator.userAgent,
				subString: &#034;Chrome&#034;,
				identity: &#034;Chrome&#034;
			},
			{ 	string: navigator.userAgent,
				subString: &#034;OmniWeb&#034;,
				versionSearch: &#034;OmniWeb/&#034;,
				identity: &#034;OmniWeb&#034;
			},
			{
				string: navigator.vendor,
				subString: &#034;Apple&#034;,
				identity: &#034;Safari&#034;,
				versionSearch: &#034;Version&#034;
			},
			{
				prop: window.opera,
				identity: &#034;Opera&#034;
			},
			{
				string: navigator.vendor,
				subString: &#034;iCab&#034;,
				identity: &#034;iCab&#034;
			},
			{
				string: navigator.vendor,
				subString: &#034;KDE&#034;,
				identity: &#034;Konqueror&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;Firefox&#034;,
				identity: &#034;Firefox&#034;
			},
			{
				string: navigator.vendor,
				subString: &#034;Camino&#034;,
				identity: &#034;Camino&#034;
			},
			{		// for newer Netscapes (6+)
				string: navigator.userAgent,
				subString: &#034;Netscape&#034;,
				identity: &#034;Netscape&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;MSIE&#034;,
				identity: &#034;Internet Explorer&#034;,
				versionSearch: &#034;MSIE&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;Gecko&#034;,
				identity: &#034;Mozilla&#034;,
				versionSearch: &#034;rv&#034;
			},
			{ 		// for older Netscapes (4-)
				string: navigator.userAgent,
				subString: &#034;Mozilla&#034;,
				identity: &#034;Netscape&#034;,
				versionSearch: &#034;Mozilla&#034;
			}
		],
		dataOs : [
			{
				string: navigator.platform,
				subString: &#034;Win&#034;,
				identity: &#034;Windows&#034;
			},
			{
				string: navigator.platform,
				subString: &#034;Mac&#034;,
				identity: &#034;Mac&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;iPhone&#034;,
				identity: &#034;iPhone/iPod&#034;
		    },
			{
				string: navigator.platform,
				subString: &#034;Linux&#034;,
				identity: &#034;Linux&#034;
			}
		], 
		dataOsVersion : [
			{
				string: navigator.userAgent,
				subString: &#034;Windows NT 5.0&#034;,
				identity: &#034;Windows NT&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;Windows NT 5.1&#034;,
				identity: &#034;Windows XP&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;Windows NT 6.0&#034;,
				identity: &#034;Windows Vista&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;Windows NT 6.1&#034;,
				identity: &#034;Windows 7&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;Windows NT 6.2&#034;,
				identity: &#034;Windows 8&#034;
			},
			{
				string: navigator.userAgent,
				subString: &#034;Mac OS X&#034;,
				identityRegExGroups: /Mac OS X ([^;]+)/gi
			},
			{
				string: navigator.userAgent,
				subString: &#034;Linux&#034;,
				identityRegExGroups: /X11; ([^\)]+)/gi
			}
		]
		
	};
	
	BrowserDetect.init();
	
	window.$.client = { 
		browser: BrowserDetect.browser,
		browserVersion: BrowserDetect.browserVersion, 
		os: BrowserDetect.os, 
		osVersion: BrowserDetect.osVersion
	};
	
})();

&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>Added OS versioning for Windows, Mac and Linux.  Tested on Win NT through Win 8, OS X 10.8, and Ubuntu.  I&#8217;m sure it needs some additional testing but works for my needs as is.  </p>
<p><code><br />
(function() {</p>
<p>	var BrowserDetect = {<br />
		init: function () {<br />
			this.browser = this.searchString(this.dataBrowser) || 'Unknown';<br />
			this.browserVersion = this.searchVersion(navigator.userAgent)<br />
				|| this.searchVersion(navigator.appVersion)<br />
				|| "Unknown";<br />
			this.os = this.searchString(this.dataOs) || 'Unknown';<br />
			this.osVersion = this.searchString(this.dataOsVersion) || 'Unknown';<br />
		},<br />
		searchString: function (data) {<br />
			for (var i=0;i&lt;data.length;i++)	{<br />
				var dataIdentityRegExGroups = data[i].identityRegExGroups;<br />
				var dataString = data[i].string;<br />
				var dataProp = data[i].prop;<br />
				this.versionSearchString = data[i].versionSearch || data[i].identity;</p>
<p>				if(dataIdentityRegExGroups) {<br />
					var matches = dataIdentityRegExGroups.exec(dataString);<br />
					if(matches) { return matches[1]; }<br />
				}<br />
				else if (dataString) {<br />
					if (dataString.indexOf(data[i].subString) != -1)<br />
						return data[i].identity;<br />
				}<br />
				else if (dataProp)<br />
					return data[i].identity;<br />
			}<br />
		},<br />
		searchVersion: function (dataString) {<br />
			var index = dataString.indexOf(this.versionSearchString);<br />
			if (index == -1) return;<br />
			return parseFloat(dataString.substring(index+this.versionSearchString.length+1));<br />
		},<br />
		dataBrowser: [<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Chrome&quot;,<br />
				identity: &quot;Chrome&quot;<br />
			},<br />
			{ 	string: navigator.userAgent,<br />
				subString: &quot;OmniWeb&quot;,<br />
				versionSearch: &quot;OmniWeb/&quot;,<br />
				identity: &quot;OmniWeb&quot;<br />
			},<br />
			{<br />
				string: navigator.vendor,<br />
				subString: &quot;Apple&quot;,<br />
				identity: &quot;Safari&quot;,<br />
				versionSearch: &quot;Version&quot;<br />
			},<br />
			{<br />
				prop: window.opera,<br />
				identity: &quot;Opera&quot;<br />
			},<br />
			{<br />
				string: navigator.vendor,<br />
				subString: &quot;iCab&quot;,<br />
				identity: &quot;iCab&quot;<br />
			},<br />
			{<br />
				string: navigator.vendor,<br />
				subString: &quot;KDE&quot;,<br />
				identity: &quot;Konqueror&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Firefox&quot;,<br />
				identity: &quot;Firefox&quot;<br />
			},<br />
			{<br />
				string: navigator.vendor,<br />
				subString: &quot;Camino&quot;,<br />
				identity: &quot;Camino&quot;<br />
			},<br />
			{		// for newer Netscapes (6+)<br />
				string: navigator.userAgent,<br />
				subString: &quot;Netscape&quot;,<br />
				identity: &quot;Netscape&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;MSIE&quot;,<br />
				identity: &quot;Internet Explorer&quot;,<br />
				versionSearch: &quot;MSIE&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Gecko&quot;,<br />
				identity: &quot;Mozilla&quot;,<br />
				versionSearch: &quot;rv&quot;<br />
			},<br />
			{ 		// for older Netscapes (4-)<br />
				string: navigator.userAgent,<br />
				subString: &quot;Mozilla&quot;,<br />
				identity: &quot;Netscape&quot;,<br />
				versionSearch: &quot;Mozilla&quot;<br />
			}<br />
		],<br />
		dataOs : [<br />
			{<br />
				string: navigator.platform,<br />
				subString: &quot;Win&quot;,<br />
				identity: &quot;Windows&quot;<br />
			},<br />
			{<br />
				string: navigator.platform,<br />
				subString: &quot;Mac&quot;,<br />
				identity: &quot;Mac&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;iPhone&quot;,<br />
				identity: &quot;iPhone/iPod&quot;<br />
		    },<br />
			{<br />
				string: navigator.platform,<br />
				subString: &quot;Linux&quot;,<br />
				identity: &quot;Linux&quot;<br />
			}<br />
		],<br />
		dataOsVersion : [<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Windows NT 5.0&quot;,<br />
				identity: &quot;Windows NT&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Windows NT 5.1&quot;,<br />
				identity: &quot;Windows XP&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Windows NT 6.0&quot;,<br />
				identity: &quot;Windows Vista&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Windows NT 6.1&quot;,<br />
				identity: &quot;Windows 7&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Windows NT 6.2&quot;,<br />
				identity: &quot;Windows 8&quot;<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Mac OS X&quot;,<br />
				identityRegExGroups: /Mac OS X ([^;]+)/gi<br />
			},<br />
			{<br />
				string: navigator.userAgent,<br />
				subString: &quot;Linux&quot;,<br />
				identityRegExGroups: /X11; ([^\)]+)/gi<br />
			}<br />
		]</p>
<p>	};</p>
<p>	BrowserDetect.init();</p>
<p>	window.$.client = {<br />
		browser: BrowserDetect.browser,<br />
		browserVersion: BrowserDetect.browserVersion,<br />
		os: BrowserDetect.os,<br />
		osVersion: BrowserDetect.osVersion<br />
	};</p>
<p>})();</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoimen</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-15610</link>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
		<pubDate>Mon, 23 Apr 2012 14:17:36 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-15610</guid>
		<description><![CDATA[@Pranjal - no, you can&#039;t.]]></description>
		<content:encoded><![CDATA[<p>@Pranjal &#8211; no, you can&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pranjal</title>
		<link>/2009/07/16/jquery-browser-and-os-detection-plugin/comment-page-1/#comment-15609</link>
		<dc:creator><![CDATA[Pranjal]]></dc:creator>
		<pubDate>Mon, 23 Apr 2012 14:11:35 +0000</pubDate>
		<guid isPermaLink="false">/?p=689#comment-15609</guid>
		<description><![CDATA[Can you tell me if I can detect OS version with this plugin, like Windows 7 and Windows XP ?]]></description>
		<content:encoded><![CDATA[<p>Can you tell me if I can detect OS version with this plugin, like Windows 7 and Windows XP ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
