<?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>Artur's Blog &#187; javascript</title>
	<atom:link href="http://artur.marnik.net/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://artur.marnik.net</link>
	<description>past, present and future in web development</description>
	<lastBuildDate>Tue, 04 Oct 2011 14:37:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why should you use jQuery</title>
		<link>http://artur.marnik.net/why-should-you-use-jquery/</link>
		<comments>http://artur.marnik.net/why-should-you-use-jquery/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 00:46:44 +0000</pubDate>
		<dc:creator>Artur</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://artur.marnik.net/?p=7</guid>
		<description><![CDATA[If you ask me one year ago &#8220;have you seen jQuery&#8221; my answer would be &#8220;have you seen what?&#8221;
If you<a href="http://artur.marnik.net/why-should-you-use-jquery/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>If you ask me one year ago &#8220;have you seen jQuery&#8221; my answer would be &#8220;have you seen what?&#8221;</p>
<p>If you ask me six months ago I would say &#8220;I heard about it but I don&#8217;t see any benefit in using it. I know javascript well enough to write my own code&#8221;.</p>
<p>And I was sooooo WRONG.</p>
<p>I just finished small project for my friend <a title="Jardins des reves" href="http://ogrody.marnik.net" target="_blank">www.jardinsdesreves.pl</a> and I decided to give it a try.<br />
The benefit: my js file is only <strong>170</strong> lines long.</p>
<p>I just want to show you couple benefits of this wonderfull framework.</p>
<p><strong>FORMS</strong>:</p>
<p>I have never seen a simpler way to submit forms via ajax.</p>
<p>Just look at the simple example:</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="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;id&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;save&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1&quot;</span>&gt;</span>
  Title: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;form_title&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span>&gt;</span>
  Content: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;form_content&quot;</span> <span style="color: #000066;">cols</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;25&quot;</span> <span style="color: #000066;">rows</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;8&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Save changes&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sendForm('text_save.php');&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&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
</pre></td><td class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> sendForm<span style="color: #009900;">&#40;</span>post_url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> request <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
  $.<span style="color: #660066;">post</span><span style="color: #009900;">&#40;</span>post_url<span style="color: #339933;">,</span> request<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    formResponse<span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span>;
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> formResponse<span style="color: #009900;">&#40;</span>resp_data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#message&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>resp_data<span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>As you can see jQuery does all job for us.<br />
There is only one requirement &#8211; each form element needs to have a name (not id).</p>
<p><a title="serialize" href="http://docs.jquery.com/Ajax/serialize" target="_blank">serialize()</a> function does great job and will post all form to &#8216;text_save.php&#8217; where we can do processing and show response to the user.</p>
<p>In the next article I will show you how to use great jQuery plugin &#8216;ajaxfileupload.js&#8217; to upload files.</p>
]]></content:encoded>
			<wfw:commentRss>http://artur.marnik.net/why-should-you-use-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>no &#8220;Hello world&#8221; today</title>
		<link>http://artur.marnik.net/no-hello-world-today/</link>
		<comments>http://artur.marnik.net/no-hello-world-today/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 03:25:00 +0000</pubDate>
		<dc:creator>Artur</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[hello world]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://artur.marnik.net/?p=3</guid>
		<description><![CDATA[This is just a beginning.
I hope to find enough time to write some articles about web development (PHP, Javascript, CSS,<a href="http://artur.marnik.net/no-hello-world-today/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>This is just a beginning.</p>
<p>I hope to find enough time to write some articles about web development (PHP, Javascript, CSS, Flex &#8230;) and my hobby photography.</p>
<p>I spend a lot of time writing code and even more time googling around for help and solutions. I know how difficult it is to find something useful. That&#8217;s why on my blog I will post only useful information and I will try not to copy anything that is already posted on other blogs.</p>
<p>Don&#8217;t expect to find a new post every day but if you have any questions or comments to my articles I will respond ASAP</p>
<p>Lets get started <img src='http://artur.marnik.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://artur.marnik.net/no-hello-world-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

