<?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>Technical stuff &#187; JavaScript</title>
	<atom:link href="http://www.tekkie.ro/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tekkie.ro</link>
	<description>Requirements are like water. They&#039;re easier to build on when they&#039;re frozen.</description>
	<lastBuildDate>Sat, 26 Nov 2011 11:35:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Form submit from JavaScript</title>
		<link>http://www.tekkie.ro/news/form-submit-from-javascript/</link>
		<comments>http://www.tekkie.ro/news/form-submit-from-javascript/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 13:50:52 +0000</pubDate>
		<dc:creator>Georgiana</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[quickies]]></category>

		<guid isPermaLink="false">http://www.tekkie.ro/?p=88</guid>
		<description><![CDATA[Be careful: if you want to submit a form from Javascript using something like this.form.submit(); or document.forms[ myFormName ].submit(); and it gives you a nasty error like submit is not a function don&#8217;t despair, just: look at the HTML source code: &#60;input id=&#34;submit&#34; name=&#34;submit&#34; value=&#34;Send to developer&#34; type=&#34;submit&#34; /&#62; change the name of the button [...]]]></description>
			<content:encoded><![CDATA[<p>Be careful: if you want to submit a form from Javascript using something like</p>
<pre class="brush: javascript">
this.form.submit();
</pre>
<p>or</p>
<pre class="brush: javascript">
document.forms[ myFormName ].submit();
</pre>
<p>and it gives you a nasty error like</p>
<pre class="brush: javascript">
submit is not a function
</pre>
<p>don&#8217;t despair, just:</p>
<ul>
<li>look at the HTML source code:
<pre class="brush: html">
&lt;input id=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Send to developer&quot; type=&quot;submit&quot;  /&gt;
</pre>
</li>
<li>change the name of the button to something else, like:
<pre class="brush: html">
&lt;input id=&quot;mySubmitButton&quot; name=&quot;mySubmitButton&quot; value=&quot;Send to developer&quot; type=&quot;submit&quot; /&gt;
</pre>
</li>
</ul>
<p>That&#8217;s all!</p>
<p>Now the explanation: the browser confuses your <code>submit();</code> call with the button object, which has no such action.</p>
<p>The browser acted just like you were explicitly calling</p>
<pre class="brush: javascript">
button = document.getElementById( &#039;submit&#039; );
button.submit();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tekkie.ro/news/form-submit-from-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScript for PHP developers</title>
		<link>http://www.tekkie.ro/resources/javascript-for-php-developers/</link>
		<comments>http://www.tekkie.ro/resources/javascript-for-php-developers/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 18:54:42 +0000</pubDate>
		<dc:creator>Georgiana</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.tekkie.ro/?p=44</guid>
		<description><![CDATA[If you're a PHP developer and you find it difficult to get used to all the insides of JavaScript, you might need PHP.JS, developed by Kevin van Zonneveld.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a PHP developer and you find it difficult to get used to all the insides of JavaScript, I think you need to take a look at <a href="http://phpjs.org/">PHP.JS</a>. It&#8217;s a brilliant tool initially developed by <a href="http://kevin.vanzonneveld.net/about/">Kevin van Zonneveld</a>, and which aims to port most of the usual PHP functions into equivalent JavaScript ones.</p>
<p>There are two ways of using this excellent codebase:</p>
<ul>
<li>grab all the <a title="one file containing all the available PHP.Js functions" href="http://kevin.vanzonneveld.net/code/php_equivalents/php.js">available PHP.JS functions</a> and use them as you need them</li>
<li>take each function you really need and put it into your JS codebase for the project</li>
</ul>
<p>The advantage of the second method is that you don&#8217;t have code you don&#8217;t need included all over the place, but it also means you will search each time the codebase to discover the code you need. Meanwhile, the first solution seems appropriate for the ones in a hurry, you just try to use one function like you&#8217;re accustomed in PHP and it&#8217;s there already included, you&#8217;re developing fast and safe, with just a small performance issue you can always address later.</p>
<p>Let&#8217;s say you&#8217;ve using the <a title="PHP long2ip function manual page" href="http://php.net/long2ip">long2ip</a> and <a title="PHP ip2long function manual page" href="http://www.php.net/ip2long">ip2long</a> PHP functions for storing IPs as numbers, and have a strong preference for using them for performance reasons, as all your IPs are stored as numbers in the database. What if you need similar functionality in JavaScript? Well, just <a title="PHP.JS long2ip function" href="http://phpjs.org/functions/long2ip:48e4b52c-c26c-4ba7-84f0-2d6486a786ee">take the code</a> <a title="PHP.JS ip2long function" href="http://phpjs.org/functions/ip2long:48e4b52b-3860-4f6c-830b-2d6486a786ee">you need</a> and use it! It&#8217;s that simple <img src='http://www.tekkie.ro/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tekkie.ro/resources/javascript-for-php-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

