<?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>Kurt Jarchow&#039;s Blog &#187; jquery</title>
	<atom:link href="http://www.kurtjarchow.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kurtjarchow.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 25 Sep 2011 17:59:58 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add Drupal Forms using AJAX</title>
		<link>http://www.kurtjarchow.com/2009/01/28/add-drupal-forms-using-ajax-jquer/</link>
		<comments>http://www.kurtjarchow.com/2009/01/28/add-drupal-forms-using-ajax-jquer/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 12:05:55 +0000</pubDate>
		<dc:creator>Kurt Jarchow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://jarchowk.wordpress.com/?p=125</guid>
		<description><![CDATA[Something very easy to do in drupal is adding form object to the content of your page without doing a page refresh.  I needed to add functionality so that an application form was displayed to a user when they clicked the Apply link.
Using JQuery we can &#8220;intercept&#8221; a client click of a link.  Add a [...]]]></description>
			<content:encoded><![CDATA[<p>Something very easy to do in drupal is adding form object to the content of your page without doing a page refresh.  I needed to add functionality so that an application form was displayed to a user when they clicked the Apply link.</p>
<p>Using JQuery we can &#8220;intercept&#8221; a client click of a link.  Add a .js file to which ever module you are editing, and add the following:</p>
<p><a id="gn55_4" class="wi" title="Drag this note to move it"></a></p>
<div class="ui"><a id="gn55_2" class="qi"></a></div>
<div class="sh">
<blockquote>
<div id="gn55_0" class="qh"> if (Drupal.jsEnabled) {  </p>
<p>  $(document).ready(function () {<br />
    $(&#8217;a.apply-link&#8217;).click(function () {</p>
<p>      var submitApplication = function(data) {<br />
        $(&#8217;div.apply-link&#8217;).html(data.html);<br />
      }</p></div>
<div class="qh">    $.ajax({<br />
      type: &#8216;POST&#8217;,<br />
      url: this.href,<br />
      dataType: &#8216;json&#8217;,<br />
      success: submitApplication,<br />
      data: &#8216;js=1&#8242;<br />
    });<br />
    return false;<br />
  });<br />
  });<br />
}</div>
</blockquote>
<div class="qh">So when a link with a class &#8220;submit-application&#8221; is clicked an ajax/json call is made to the url.  Now make sure the js is included somewhere in your module code by using drupal_add_js(). </div>
</div>
<div class="qh">Now all we have to do is make sure the page renders as json if an ajax call is made.  Add this  code just before the _page exits (but not after the exit(); !).</div>
<blockquote>
<div class="qh"> if (!empty($_POST['js'])) {<br />
    $html = drupal_get_form(&#8217;job_posting_application_form&#8217;, array($node-&gt;nid, $node-&gt;title, $node-&gt;job_posting_email));<br />
    drupal_json(array(<br />
    &#8216;html&#8217; =&gt;  $html<br />
    )<br />
    );</div>
</blockquote>
<div class="qh">Your link should be replaced with the form.</div>
<div class="qh">If you want to add a little bit of animation use the jQuery animation options.  Instead of just replacing the link, make it fade in:</div>
<blockquote>
<div class="qh">$(&#8217;div.apply-link&#8217;).hide();<br />
$(&#8217;div.apply-link&#8217;).html(data.html);<br />
$(&#8217;div.apply-link&#8217;).fadeIn();</div>
</blockquote>
<div class="qh">Credit to <a href="http://www.drupalbook.com/">John K. VanDyk&#8217;s book</a> for breaking the back of this code.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.kurtjarchow.com/2009/01/28/add-drupal-forms-using-ajax-jquer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Building a Multinational Website</title>
		<link>http://www.kurtjarchow.com/2008/11/19/building-a-multinational-website/</link>
		<comments>http://www.kurtjarchow.com/2008/11/19/building-a-multinational-website/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 22:28:26 +0000</pubDate>
		<dc:creator>Kurt Jarchow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[sorl]]></category>

		<guid isPermaLink="false">http://jarchowk.wordpress.com/?p=53</guid>
		<description><![CDATA[There is nothing easy about building a multiple-location, multi-lingual website.  The options are getting better and better however to make this as smooth as possible.
I&#8217;ve been blogging about my experiences, starting from scratch, learning the LAMP stack and delivering a high quality, high performance solutions.  I&#8217;ve had my head in a few books lately; a [...]]]></description>
			<content:encoded><![CDATA[<p>There is nothing easy about building a multiple-location, multi-lingual website.  The options are getting better and better however to make this as smooth as possible.</p>
<p>I&#8217;ve been blogging about my experiences, starting from scratch, learning the LAMP stack and delivering a high quality, high performance solutions.  I&#8217;ve had my head in a few books lately; a php beginners book, a php advanced book, and a Drupal Pro book.  My eyes are heavy but I have a prototype to my end solution.</p>
<p>Building a solr search driven search site is completely painless, and getting faceted search options are completely customizable.  Out of the box, Drupal gives our website about 60% of our functionality.</p>
<p>However, be prepared: Drupal is a whole other language unto itself.  Coming from a nice SDK an a .Net environment, the vast number of function names you need to remember is quite dawnting.  .Net feels much cleaner- that being said I think I can do much more with the php code.</p>
<p>My next steps will be mastering the Jquery integration.  This site needs to feel real 2.0, and I plan on keeping up with key AJAX function.</p>
<p>That&#8217;s it for me tonight, time for some sleep.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kurtjarchow.com/2008/11/19/building-a-multinational-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

