<?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>JimBergman.net &#187; javascript</title>
	<atom:link href="http://jimbergman.net/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://jimbergman.net</link>
	<description>startups &#124; technology &#124; design &#124; software development</description>
	<lastBuildDate>Sat, 12 May 2012 06:31:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Mobile Browser Reported Screen Sizes – Feb 2012</title>
		<link>http://jimbergman.net/mobile-browser-reported-screen-sizes-2012-02/</link>
		<comments>http://jimbergman.net/mobile-browser-reported-screen-sizes-2012-02/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 06:59:29 +0000</pubDate>
		<dc:creator>Jim Bergman</dc:creator>
				<category><![CDATA[mobile development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile browser]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://jimbergman.net/?p=342</guid>
		<description><![CDATA[This is the second post in a series. If you missed the first post, you can read it here. More information about Android screen sizes was gathered this last month, and is analyzed below. Android phones 320 px width – 85% of devices queried &#8211; phone 360 px width – 4.5% of devices queried &#8211; ...]]></description>
			<content:encoded><![CDATA[<p>This is the second post in a series. If you missed the first post, you can <a href="http://jimbergman.net/mobile-browser-reported-screen-sizes-2012-01/" title="Mobile Browser Reported Screen Sizes – Jan 2012">read it here</a>.</p>
<p>More information about Android screen sizes was gathered this last month, and is analyzed below.</p>
<p>Android phones<br />
320 px width – 85% of devices queried &#8211; phone<br />
360 px width – 4.5% of devices queried &#8211; phone<br />
400 px width – 5% of devices queried &#8211; 5.3&#8243; screen size<br />
600 px width – 1% of devices queried &#8211; tablets<br />
800 px width – 4.5% of devices queried &#8211; tablets</p>
<p>The screen sizes are becoming more varied with new devices with new screen sizes and resolutions becoming available, making it ever more challenging for the Android developer.</p>
<p>How is this information useful to you in developing apps?</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbergman.net/mobile-browser-reported-screen-sizes-2012-02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Browser Reported Screen Sizes &#8211; Jan 2012</title>
		<link>http://jimbergman.net/mobile-browser-reported-screen-sizes-2012-01/</link>
		<comments>http://jimbergman.net/mobile-browser-reported-screen-sizes-2012-01/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 06:46:39 +0000</pubDate>
		<dc:creator>Jim Bergman</dc:creator>
				<category><![CDATA[mobile development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile browser]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://jimbergman.net/?p=313</guid>
		<description><![CDATA[UPDATE: this post is for Jan 2012, click here for the Feb 2012 report. HTML5 / CSS3 development for mobile browsers needs to be aware of the reported screen size to effectively build a mobile site. However, the screen resolution listed in the device specifications is NOT the same as what is reported by the ...]]></description>
			<content:encoded><![CDATA[<p>UPDATE: this post is for Jan 2012, <a href="http://jimbergman.net/mobile-browser-reported-screen-sizes-2012-02/">click here for the Feb 2012 report</a>.</p>
<p>HTML5 / CSS3 development for mobile browsers needs to be aware of the reported screen size to effectively build a mobile site.</p>
<p>However, the screen resolution listed in the device specifications is NOT the same as what is reported by the mobile browser itself. Specifically, what is the window size information available via JavaScript using window.innerWidth and window.innerHeight. It is usually very different than the device&#8217;s screen resolution.<br />
<span id="more-313"></span><br />
The iPhone and iPad are consistent and predictable. All iPhones report a window size of 320 x 460, and all iPads report a window size of 768 x 1004.</p>
<p>The &#8216;fun&#8217; part is supporting the wide variety of window sizes on Android devices. However, it is exceptionally hard to find data on the window size different devices report via JavaScript.</p>
<p>A month ago I released a <a href="https://bitly.com/scorekeepr-android" title="link to ScoreKeepr app in Android Market" target="_blank">mobile app for Android</a> and <a href="https://bitly.com/scorekeepr-ios" title="link to ScoreKeepr app in Apple iOS App Store" target="_blank">iOS called ScoreKeepr</a>. During the update check to my server, the app reports the device&#8217;s windows size.</p>
<p>Here are the most common reported screen sizes for Android devices (in Portrait orientation):</p>
<p>Android phones<br />
320 px width &#8211; 90% of devices queried<br />
360 px width &#8211; 10% of devices queried</p>
<p>Android tablets<br />
800 px width &#8211; 1 device reporting (insufficient data)</p>
<p>Using this information, you can more easily develop your CSS media queries, knowing what sizes your app is likely to encounter in the wild.</p>
<p>This will be an ongoing monthly report, and will reflect different reported window sizes when new devices are introduced. By regularly reporting this information, a trend over time can be identified.</p>
<p>What information are you collecting from your apps? Please share your suggestions for additional anonymous information to collect. Information must be available via JavaScript query.</p>
<p>UPDATE FEB 1st: final numbers for January 2012 included</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbergman.net/mobile-browser-reported-screen-sizes-2012-01/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebSockets NOT supported in iOS 4.0</title>
		<link>http://jimbergman.net/websockets-iphone-os-4/</link>
		<comments>http://jimbergman.net/websockets-iphone-os-4/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 08:58:36 +0000</pubDate>
		<dc:creator>Jim Bergman</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[website development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[iOS4]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone os 4]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[websocket]]></category>
		<category><![CDATA[websocket example]]></category>
		<category><![CDATA[websocket test]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://jimbergman.net/?p=181</guid>
		<description><![CDATA[UPDATE December 2010: iOS 4.2 now has websocket support UPDATE July 2010: since the beta 2 release of iOS4, Apple has disabled websockets support. A few readers pointed this out, so I made a trip to an Apple Store it run a few tests. Confirmed: iOS4 as it is released reports it does NOT have ...]]></description>
			<content:encoded><![CDATA[<p><b>UPDATE December 2010:</b> <a href="http://jimbergman.net/websockets-supported-in-ios-4-2/">iOS 4.2 now has websocket support</a></p>
<p><b>UPDATE July 2010:</b> since the beta 2 release of iOS4, Apple has disabled websockets support. A few readers pointed this out, so I made a trip to an Apple Store it run a few tests.</p>
<p><a href="http://jimbergman.net/wp-content/uploads/2010/07/iPhone4_iOSv4_WebSocket_test.png" rel="prettyPhoto"><img src="http://jimbergman.net/wp-content/uploads/2010/07/iPhone4_iOSv4_WebSocket_test_sm.png" title="iPhone4 iOS v4 WebSocket test" width="320" height="480" class="aligncenter size-full wp-image-187" /></a></p>
<p>Confirmed: iOS4 as it is released reports it does NOT have websocket support.</p>
<p>
ORIGINAL POST:</p>
<p>Since the Safari web browser on the iPhone is based on WebKit, it makes sense that at some point support for WebSockets would make it to the iPhone.</p>
<p>Safari on iPhone OS 4.0 beta 2 supports WebSocket.</p>
<p><img src="http://jimbergman.net/wp-content/images/WebSocketTest_iPhone_4.0b2.png"></p>
<p>Once OS 4 is available for the iPad, support should be there as well.</p>
<p>Thanks to reader <a href="http://tech.element77.com/2010/04/safari-on-iphone-os-40-supports.html">Arun for pointing this out</a>.</p>
<p><a href="http://creativecommons.org/about/licenses/"><img src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" title="Creative Commons - Attribution Non-Commercial Share Alike" border=0></a></p>
<p><span style="display: none;"><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" /></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">WebSockets NOT supported in iOS 4.0</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://jimbergman.net/websockets-iphone-os-4/" property="cc:attributionName" rel="cc:attributionURL">Jim Bergman</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.<br />Permissions beyond the scope of this license may be available at <a xmlns:cc="http://creativecommons.org/ns#" href="http://jimbergman.net/about" rel="cc:morePermissions">http://jimbergman.net/about</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://jimbergman.net/websockets-iphone-os-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Test your web browser for WebSocket support</title>
		<link>http://jimbergman.net/websocket-web-browser-test/</link>
		<comments>http://jimbergman.net/websocket-web-browser-test/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 01:34:50 +0000</pubDate>
		<dc:creator>Jim Bergman</dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[website development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[websocket]]></category>
		<category><![CDATA[websocket example]]></category>
		<category><![CDATA[websocket test]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://jimbergman.net/?p=102</guid>
		<description><![CDATA[Google announced an improved way for a web application to communicate with a server. The new method is called WebSockets. You can read more info here on WebSockets. Here is a quick test to see if your web browser supports WebSockets. At the time this post was published Google Chrome developer channel release 4.0.249.0 is ...]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://jimbergman.net/scripts/WebSocketTest.js"></script>Google announced an improved way for a web application to communicate with a server. The new method is called WebSockets. You can <a href="http://blog.chromium.org/2009/12/web-sockets-now-available-in-google.html" target="_new">read more info here on WebSockets</a>.</p>
<p>Here is a quick test to see if your web browser supports WebSockets. At the time this post was published Google Chrome developer channel release 4.0.249.0 is the only browser to support WebSockets.</p>
<p><center><a href="javascript:WebSocketTest()" title="Click here to run WebSocket test"><img src="http://jimbergman.net/wp-content/images/WebSocketTest.png" border=0></a></center><br />
<span id="more-102"></span></p>
<p>
<p>Here is the JavaScript code (<a href="http://jimbergman.net/scripts/WebSocketTest.js">or right click and save file as <code>WebSocketTest.js</code></a>):
<pre>
function WebSocketTest()
{
  if (&quot;WebSocket&quot; in window)
  {
    // Google example code
    //  var ws = new WebSocket(&quot;ws://example.com/service&quot;);
    //  ws.onopen = function()
    //  {
    //    // WebSocket is connected. You can send data by send() method
    //    ws.send(&quot;message to send&quot;); ....
    //  };
    //  ws.onmessage = function (evt) { var received_msg = evt.data; ... };
    //  ws.onclose = function() { // websocket is closed. };
    alert(&quot;WebSockets supported here!\r\n\r\nBrowser: &quot; + navigator.userAgent + &quot;\r\n\r\ntest by jimbergman.net (based on Google sample code)&quot;);
  }
  else
  {
    // the browser doesn\&#039;t support WebSockets
    alert(&quot;WebSockets NOT supported here!\r\n\r\nBrowser: &quot; + navigator.userAgent + &quot;\r\n\r\ntest by jimbergman.net (based on Google sample code)&quot;);
  }
}
</pre>
<p>Sample HTML code (save file as <code>WebSocketTest.html</code> in same folder as <code>.js</code> file above):
<pre>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;JimBergman.net - JavaScript: WebSocketTest&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;WebSocketTest.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body bgcolor=&quot;#FFFFFF&quot;&gt;
&lt;a href=&quot;javascript:WebSocketTest()&quot;&gt;Run WebSocket test&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><center><br />
<hr width=75%>UPDATE May 4th, 2012:<br />
<hr width=75%>
<p>Updated to report browser data using navigator.userAgent.<br \>The previous version of this script used browser data from navigator.appName and navigator.appVersion, which are not consistent in different browsers (mainly Firefox).</p>
<p><center><br />
<hr width=75%>UPDATE:<br />
<hr width=75%>
<p>Result of this test on an Windows 7 PC in Google Chrome v4.0.249.0</p>
<p><img src="http://jimbergman.net/wp-content/images/WebSocketTest_Chrome_4.0.249.0.png"></p>
<hr width=75%>
<p>Result of this test on an Windows 7 PC in Mozilla Firefox v3.5.5</p>
<p><img src="http://jimbergman.net/wp-content/images/WebSocketTest_Firefox_3.5.5.png"></p>
<hr width=75%>
<p>Result of this test on an Windows 7 PC in Microsoft Internet Explorer v8.0.7100.0</p>
<p><img src="http://jimbergman.net/wp-content/images/WebSocketTest_IE8_0.7100.0.png"></p>
<hr width=75%>
<p>Result of this test on an Apple iPhone in OS 3.1.2</p>
<p><img src="http://jimbergman.net/wp-content/images/WebSocketTest_iPhone_IMG_0981.png"></p>
<p></center></p>
<p><a href="http://creativecommons.org/about/licenses/"><img src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" title="Creative Commons - Attribution Non-Commercial Share Alike" border=0></a></p>
<p><span style="display: none;"><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" /></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">Test your web browser for WebSocket support</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://jimbergman.net/websocket-web-browser-test/" property="cc:attributionName" rel="cc:attributionURL">Jim Bergman</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.<br />Permissions beyond the scope of this license may be available at <a xmlns:cc="http://creativecommons.org/ns#" href="http://jimbergman.net/about" rel="cc:morePermissions">http://jimbergman.net/about</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://jimbergman.net/websocket-web-browser-test/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
	</channel>
</rss>

