<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Thoughts on Design &#187; Browser Sniffer</title>
	<atom:link href="http://www.jamischarles.com/blog/tag/browser-sniffer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jamischarles.com/blog</link>
	<description>Thoughts on Web Design and Front-end Coding. Served up Monthly by Jamis Charles</description>
	<lastBuildDate>Fri, 06 Jan 2012 21:11:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to apply javascript to one specific browser (browser sniffer)</title>
		<link>http://www.jamischarles.com/blog/how-to-apply-javascript-to-one-specific-browser-browser-sniffer/</link>
		<comments>http://www.jamischarles.com/blog/how-to-apply-javascript-to-one-specific-browser-browser-sniffer/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 14:11:08 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Browser Sniffer]]></category>

		<guid isPermaLink="false">http://www.bluebreeze.net/blog/?p=28</guid>
		<description><![CDATA[What if you have JavaScript that only works in one browser? What if you&#8217;re using IE and Firefox. Well, you need to write one statement that will execute in IE, then another statement to run in the Firefox. This is also called a browser sniffer. Here&#8217;s how you can do it. First we&#8217;ll show you [...]]]></description>
			<content:encoded><![CDATA[<p>What if you have JavaScript that only works in one browser? What if you&#8217;re using IE and Firefox. Well, you need to write one statement that will execute in IE, then another statement to run in the Firefox. This is also called a browser sniffer.<br />
Here&#8217;s how you can do it.<br />
First we&#8217;ll show you how to write a catch so it&#8217;ll run 1 statement if it is IE, and another if it&#8217;s any other browser.</p>
<pre class="js">
&lt;script type="text/javascript"&gt;
var browser = navigator.appName; //find the browser name

alert(browser); //popup with the browser name

if(browser == "Microsoft Internet Explorer"){
    alert("You are using IE");
}else{
    alert("you are using a different browser than IE");
}
&lt;/script&gt;</pre>
<p>Usually the code above suffices, because most JavaScript will either work in IE or the other browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/how-to-apply-javascript-to-one-specific-browser-browser-sniffer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

