<?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>Scott Rockers&#039; Blog &#187; javascript</title>
	<atom:link href="http://scottrockers.com/blog/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://scottrockers.com/blog</link>
	<description>Website Designer and Developer, Flash, Wordpress, jQuery, and Other Scripts</description>
	<lastBuildDate>Mon, 22 Aug 2011 21:48:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to Detect Android and Redirect to Android Version Website</title>
		<link>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-android-and-redirect-to-android-version-website</link>
		<comments>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-android-and-redirect-to-android-version-website#comments</comments>
		<pubDate>Tue, 22 Feb 2011 17:06:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Simple Code Tricks]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Detection]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[redirect script]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=1185</guid>
		<description><![CDATA[I have been posting redirect scripts for several devices such as the iphone and ipad, and I thought why not add android to the list. I own a android phone and I love it, and I have tested this script so I know it works. This code detects whether the person viewing your website is [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://scottrockers.com/blog/wp-content/uploads/2011/02/android-phone.jpg" alt="android-phone" title="android-phone" width="316" height="473" class="aligncenter size-full wp-image-1192" /></p>
<p>I have been posting redirect scripts for several devices such as the iphone and ipad, and I thought why not add android to the list. I own a android phone and I love it, and I have tested this script so I know it works. This code detects whether the person viewing your website is on a <a href="http://developer.android.com/index.html" title="android">Android</a> device. If they are on a Android phone, you can redirect them to a android version website or just to another page, its up to you. If they are on a normal computer it doesn&#8217;t redirect them and they go on as normal. Its just some simple javascript, and if you want to use it just change the &#8220;document.location&#8221; value to the url you want them redirected. Here is the code, and its just the same as when you <a href="http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-iphone-and-redirect-to-iphone-version-website" title="detect iphone">detect for iPhone</a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span> <span style="color: #006600; font-style: italic;">// &lt;![CDATA[</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Android'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		document.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://www.yoururladdress.com/yourpage.html&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #006600; font-style: italic;">// ]]&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-android-and-redirect-to-android-version-website/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>jQuery Cycle Plugin &#8211; A Slideshow Creator Javascript File</title>
		<link>http://scottrockers.com/blog/resources/tutorials/jquery-cycle-plugin-a-slideshow-creator-javascript-file</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/jquery-cycle-plugin-a-slideshow-creator-javascript-file#comments</comments>
		<pubDate>Tue, 16 Feb 2010 18:19:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=905</guid>
		<description><![CDATA[Here is another useful script that I wanted to write a quick post about. Its called jQuery Cycle Plugin, and its an additional javascript file that basically allows you to create a slideshow very easily and it supports many different types of transition effects. It &#8216;s dual licensed under the MIT and GPL licenses which [...]]]></description>
			<content:encoded><![CDATA[<div class="cyclebannerexample" style="width:82px; height:82px;" align="center">
    <img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/233158.jpg" width="80" height="80" /><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/271131.jpg" width="80" height="80" /><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/216505.jpg" width="80" height="80" /><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/260178.jpg" width="80" height="80" /><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/115908.jpg" width="80" height="80" />
</div>
<p>Here is another useful script that I wanted to write a quick post about. Its called <a title="jquery cycle plugin" href="http://www.malsup.com/jquery/cycle/" target="_blank">jQuery Cycle Plugin</a>, and its an additional javascript file that basically allows you to create a slideshow very easily and it supports many different types of transition effects. It &#8216;s dual licensed under the MIT and GPL licenses which is great so you can use it in basically any project. If you don&#8217;t want to use Flash this is a really simple way to setup a slideshow that will show in all browsers. Some of the transitions are:  scrollup,  scrollleft,  scrollright,  scrolldown,  shuffle, and turndown. The images above is an example of it in action, and here is the code to it, really simple.</p>
<p>There are two things you need to add to your &lt;head&gt; section in your html, the css and javascript import lines:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
<span style="color: #6666ff;">.banner</span> <span style="color: #00AA00;">&#123;</span>  
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span>  <span style="color: #933;">82px</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span>   <span style="color: #933;">82px</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
<span style="color: #6666ff;">.banner</span> img <span style="color: #00AA00;">&#123;</span>   
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span>  <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>   
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span>  <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> 
<span style="color: #00AA00;">&#125;</span> 
<span style="color: #6666ff;">.banner</span> img <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span> <span style="color: #00AA00;">&#125;</span> //these lines <span style="color: #993333;">hide</span> all the rest of the pictures on startup 
<span style="color: #6666ff;">.banner</span> img<span style="color: #6666ff;">.first</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span> <span style="color: #00AA00;">&#125;</span> //except the first image
&nbsp;
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;!-- include jQuery library --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;!-- include Cycle plugin --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.72.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.banner'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">cycle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			fx<span style="color: #339933;">:</span> <span style="color: #3366CC;">'scrollLeft'</span> <span style="color: #006600; font-style: italic;">//  transition type, scrollleft</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>And here is the image code, just add this anywhere in your &lt;body&gt;, just make sure the class name is the same as what the javascript is looking for:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;banner&quot;&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/233158.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/271131.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/216505.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/260178.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/115908.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
&lt;/div&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/jquery-cycle-plugin-a-slideshow-creator-javascript-file/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery: The Write Less, Do More Javascript Library</title>
		<link>http://scottrockers.com/blog/resources/useful-websites/jquery-the-write-less-do-more-javascript-library</link>
		<comments>http://scottrockers.com/blog/resources/useful-websites/jquery-the-write-less-do-more-javascript-library#comments</comments>
		<pubDate>Fri, 12 Feb 2010 16:57:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Useful Websites]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=892</guid>
		<description><![CDATA[Keeping up with the latest trends in web development is tough sometimes, only because there are new things always being created. jQuery is  one of the newer creations that have come up in the last several years and its not going away. It is the most popular JavaScript library in use today. If you don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-893" style="border: 1px solid white;" title="jquery" src="http://scottrockers.com/blog/wp-content/uploads/2010/02/jquery.jpg" alt="" width="390" height="117" /></p>
<p>Keeping up with the latest trends in web development is tough sometimes, only because there are new things always being created. jQuery is  one of the newer creations that have come up in the last several years and its not going away. It is the most popular JavaScript library in use today. If you don&#8217;t know what jQuery is then here is a brief description: <a title="jQuery Website" href="http://jquery.com/" target="_blank">jQuery</a> is a JavaScript Library that is fast and concise that makes HTML document traversing, event handling, animating, and <a title="AJAX programming" href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" target="_blank">Ajax</a> interactions for rapid web development much easier. &#8220;<strong>jQuery is designed to change the way that you write JavaScript.&#8221; </strong>It&#8217;s lightweight, around 23kb, and cross browser compliant and compliant with CSS3 as well. You can create sliding banners, dropdown navigations, and much more with it. I am trying to learn more and more of it everyday, and its pretty exciting. jQuery is provided under the MIT and GPL licenses which means you can use it in your commercial projects like selling of themes and stuff. There are several good tutorials and other helpful resources on their website and I would highly recommend it and learning some yourself.</p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/useful-websites/jquery-the-write-less-do-more-javascript-library/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Developer Toolbar Add-on for Firefox</title>
		<link>http://scottrockers.com/blog/resources/useful-websites/web-developer-toolbar-add-on-for-firefox</link>
		<comments>http://scottrockers.com/blog/resources/useful-websites/web-developer-toolbar-add-on-for-firefox#comments</comments>
		<pubDate>Fri, 05 Feb 2010 21:34:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Useful Websites]]></category>
		<category><![CDATA[add-on]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=887</guid>
		<description><![CDATA[I wanted to take a second to talk about an awesome add-on for firefox: the Web Developer Toolbar. The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It&#8217;s a must have for all developers and designers because it saves countless hours of developing and troubleshooting time, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://scottrockers.com/blog/wp-content/uploads/2010/02/webdevelopertoolbar.jpg" rel="shadowbox[post-887];player=img;"><img class="aligncenter size-medium wp-image-888" style="border: 1px solid white;" title="webdevelopertoolbar" src="http://scottrockers.com/blog/wp-content/uploads/2010/02/webdevelopertoolbar-300x223.jpg" alt="" width="300" height="223" /></a></p>
<p>I wanted to take a second to talk about an awesome add-on for firefox: the <a title="Web Developer Toolbar" href="https://addons.mozilla.org/en-US/firefox/addon/60" target="_blank">Web Developer Toolbar</a>. The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It&#8217;s a must have for all developers and designers because it saves countless hours of developing and troubleshooting time, and it has tons of really great features. One of those great features is the ability to edit the CSS of a website in real time and see your changes updated on the web page as you type them. Then you can save out the changes you made and update accordingly. This alone can save you tons of time when  sifting through the files on your server searching for the correct CSS file to update, uploading  changes you made to it and then refreshing the browser to see the changes.  Another really nice feature is the one-click validating of your page&#8217;s HTML, CSS, and javascript. Instead of going to the <a title="W3C Markup Validation Website" href="http://validator.w3.org/" target="_blank">W3C Markup Validation Website</a>, and manually copying and pasting the urls into the field. It automatically does it for you, SO TIGHT!!!!! There are several other features of it that are really nice and if you are a designer or developer of websites I highly recommend it.</p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/useful-websites/web-developer-toolbar-add-on-for-firefox/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArkansasHSA.com Website</title>
		<link>http://scottrockers.com/blog/portfolio/work-projects/arkansashsa-com-website</link>
		<comments>http://scottrockers.com/blog/portfolio/work-projects/arkansashsa-com-website#comments</comments>
		<pubDate>Wed, 03 Feb 2010 16:11:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Work Projects]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[cu3er]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=878</guid>
		<description><![CDATA[Here is another website I work on at my job, its called ArkansasHSA.com. It&#8217;s a informational website for HSAs (Health Savings Accounts) for Arkansas State Employees and Arkansas Public School Employees. The before and after images are below and there are a few things I updated on the site I want to point out. I [...]]]></description>
			<content:encoded><![CDATA[<p>Here is another website I work on at my job, its called <a href="http://www.arkansashsa.com/" target="_blank">ArkansasHSA.com</a>. It&#8217;s a informational website for HSAs (Health Savings Accounts) for Arkansas State Employees and Arkansas Public School Employees. The before and after images are below and there are a few things I updated on the site I want to point out. I updated the banner of the page with <a href="http://www.progressivered.com/cu3er/" target="_blank">CU3ER</a> once again because its just so easy to use and really professional looking, and it doesn&#8217;t take much time to setup.  Also, I updated the navigation of the website, which is really important because iI a user can&#8217;t find what they are looking for on the site then you have a huge problem. I used  <a title="Pro Dropdown 2" href="http://www.stunicholls.com/menu/pro_dropdown_2.html" target="_blank">Pro Dropdown 2</a>, which is a really nice free dropdown navigation, if you use it just make sure to keep all the copyright information in the CSS and Javascript files provided.  The nice thing about it is that its cross browser compatible and really easy to use and easy to create your own style.    Also, the layout was fluid before which made the page stretch out way to far and just made the site look old to me, so I made it have a static width of 1024px and created a simple background for it and moved some other stuff around on the pages. The image on the left is the after picture and the image on the right is the before, sorry they aren&#8217;t the other way around but on my portfolio page I have a Flash script to grab the first image in the post to display and I wanted the &#8216;After image&#8217; to show up.</p>
<table border="0" width="100%">
<tbody>
<tr>
<th scope="col"> <a href="http://scottrockers.com/blog/wp-content/uploads/2010/02/arkansashsaAFTER.jpg" rel="shadowbox[post-878];player=img;"><img class="aligncenter size-medium wp-image-879" title="arkansashsaAFTER" src="http://scottrockers.com/blog/wp-content/uploads/2010/02/arkansashsaAFTER-300x194.jpg" alt="" width="300" height="194" /></a></th>
<th scope="col"><a href="http://scottrockers.com/blog/wp-content/uploads/2010/02/arkansashsaBEFORE.jpg" rel="shadowbox[post-878];player=img;"><img class="aligncenter size-medium wp-image-880" title="arkansashsaBEFORE" src="http://scottrockers.com/blog/wp-content/uploads/2010/02/arkansashsaBEFORE-300x172.jpg" alt="" width="300" height="172" /></a></th>
</tr>
</tbody>
</table>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/portfolio/work-projects/arkansashsa-com-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Detect iPad and Redirect to iPad Version Website</title>
		<link>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-ipad-and-redirect-to-ipad-version-website</link>
		<comments>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-ipad-and-redirect-to-ipad-version-website#comments</comments>
		<pubDate>Tue, 02 Feb 2010 21:05:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Simple Code Tricks]]></category>
		<category><![CDATA[Detection]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=868</guid>
		<description><![CDATA[With all the buzz about the iPad, I wanted to post another useful snippet of code. It detects whether the person viewing your website is on a iPad. If they are on a iPad, you can redirect them to a iPad version website or just to another page, its up to you. If they are [...]]]></description>
			<content:encoded><![CDATA[<p>With all the buzz about the <a href="http://www.apple.com/ipad/">iPad</a>, I wanted to post another useful snippet of code. It detects whether the person viewing your website is on a iPad. If they are on a iPad, you can redirect them to a iPad version website or just to another page, its up to you. If they are on a normal computer it doesn&#8217;t redirect them and they go on as normal. Its just some simple javascript, and if you want to use it just change the &#8220;document.location&#8221; value to the url you want them redirected. Here is the code, and its just the same as when you detect for the iPhone with an extra argument.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span> <span style="color: #006600; font-style: italic;">// &lt;![CDATA[</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'iPhone'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'iPod'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'iPad'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		document.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://www.scottrockers.com/iphone.html&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #006600; font-style: italic;">// ]]&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-ipad-and-redirect-to-ipad-version-website/feed</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
	</channel>
</rss>

