<?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>Denover &#187; how to</title>
	<atom:link href="http://denover.com/tag/how-to/feed" rel="self" type="application/rss+xml" />
	<link>http://denover.com</link>
	<description>Блог для всех и обо всём</description>
	<lastBuildDate>Sat, 28 Jan 2012 18:52:34 +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 disable &quot;Enter Key&quot; to submit?</title>
		<link>http://denover.com/how-to-disable-enter-key-to-submit/174?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-disable-enter-key-to-submit</link>
		<comments>http://denover.com/how-to-disable-enter-key-to-submit/174#comments</comments>
		<pubDate>Wed, 26 Nov 2008 17:17:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Новости]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.denover.com/?p=174</guid>
		<description><![CDATA[&#60;form action=&#187;foo&#187;&#62; &#60;input type=&#187;text&#187; onkeypress=&#187;return bar(event)&#187;&#62; &#60;input type=&#187;submit&#187;&#62; &#60;/form&#62; &#60;script type=&#187;text/javascript&#187;&#62; function bar(evt){ var k=evt.keyCode&#124;&#124;evt.which; return k!=13; } &#60;/script&#62; Note however that this &#171;enter&#187; key behavior isn&#8217;t standard (and actually behaves differently across user agents); moreover this won&#8217;t prevent you from full server-side checking, as a client can have javascript deactivated (or even trick your [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&lt;form action=&raquo;foo&raquo;&gt;<br />
&lt;input type=&raquo;text&raquo; onkeypress=&raquo;return bar(event)&raquo;&gt;<br />
&lt;input type=&raquo;submit&raquo;&gt;<br />
&lt;/form&gt;</p>
<p>&lt;script type=&raquo;text/javascript&raquo;&gt;<br />
function bar(evt){<br />
var k=evt.keyCode||evt.which;<br />
return k!=13;<br />
}<br />
&lt;/script&gt;</p></blockquote>
<p>Note however that this &laquo;enter&raquo; key behavior isn&#8217;t standard (and actually behaves differently across user agents); moreover this won&#8217;t prevent you from full server-side checking, as a client can have javascript deactivated (or even trick your javascript at runtime).</p>
]]></content:encoded>
			<wfw:commentRss>http://denover.com/how-to-disable-enter-key-to-submit/174/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>foreach in JavaScript</title>
		<link>http://denover.com/foreach-in-javascript/104?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=foreach-in-javascript</link>
		<comments>http://denover.com/foreach-in-javascript/104#comments</comments>
		<pubDate>Tue, 08 Jul 2008 08:22:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Компьютеры]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.denover.com/?p=104</guid>
		<description><![CDATA[Actually that&#8217;s not true at all. As all javascript objects are really just associative arrays, there is a foreach like syntax for the &#8216;for&#8217; construct. Without it it would be very hard to work with many common javascript objects. It&#8217;s actually very simple to use and incredibly useful if you like associative arrays. You just [...]]]></description>
			<content:encoded><![CDATA[<p>Actually that&#8217;s not true at all.<br />
As all javascript objects are really just associative arrays, there is a foreach like syntax for the &#8216;for&#8217; construct.<br />
Without it it would be very hard to work with many common javascript objects.<br />
It&#8217;s actually very simple to use and incredibly useful if you like associative arrays.</p>
<p>You just have to make sure to use it on an associative array and not an object.<br />
Example below</p>
<p><span id="more-104"></span></p>
<p><strong><em>Good (assuming Object has not been overloaded or extended):</em></strong></p>
<blockquote><p>var array = new Object(); //this is safe only if you can assure object has not been extended.<br />
//use the below if Object has been extended<br />
var array;</p>
<p>//everything below here works fine regardless of the two above cases<br />
array['something'] = &#8216;yay&#8217;;<br />
array['somethingelse'] = &#8216;more&#8217;;</p>
<p>for ( keyVar in array ) {<br />
alert(array[keyVar]);<br />
}</p></blockquote>
<p><strong><em>Bad:</em></strong></p>
<blockquote><p>var array = new Array(); //uh oh, array is an object which means it&#8217;s an associative array</p>
<p>//the below loop will actually give you results, despite never putting &laquo;values&raquo; into<br />
//the array variable. This is because array has functions defined from the Array() object<br />
//which will be grabbed by the keyVar since objects are really associative arrays<br />
for ( keyVar in array ) {<br />
alert(array[keyVar]);<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://denover.com/foreach-in-javascript/104/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

