<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>has_many :thoughts: request.xhr? is only for Prototype?</title>
    <link>http://blog.kineticweb.com/articles/2008/03/26/request-xhr-is-only-for-prototype</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Musings from a Ruby on Rails development team</description>
    <item>
      <title>request.xhr? is only for Prototype?</title>
      <description>&lt;p&gt;I just found this lovely tid-bit of information in the &lt;a href="http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html#M000407"&gt;ActionController::AbstractRequest&lt;/a&gt; class&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# Returns true if the request's &amp;quot;X-Requested-With&amp;quot; header contains
# &amp;quot;XMLHttpRequest&amp;quot;. (The Prototype Javascript library sends this header with
# every Ajax request.)
def xml_http_request?
    !(@env['HTTP_X_REQUESTED_WITH'] !~ /XMLHttpRequest/i)
end
alias xhr? :xml_http_request?&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Mental note for later: Make sure to set this header when using jQuery in future projects&amp;#8230;. Not sure if jQuery does this already (probably not).&lt;/p&gt;</description>
      <pubDate>Wed, 26 Mar 2008 13:12:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:cf7dfbc4-7c45-41ed-b53d-24f0aa3e9021</guid>
      <author>Justin Reagor</author>
      <link>http://blog.kineticweb.com/articles/2008/03/26/request-xhr-is-only-for-prototype</link>
      <category>actionpack</category>
      <category>Javascript</category>
      <category>AJAX</category>
    </item>
    <item>
      <title>"request.xhr? is only for Prototype?" by eric</title>
      <description>HA HA!  Now you're wrong three times!</description>
      <pubDate>Thu, 27 Mar 2008 13:50:45 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:8e2f8805-6043-4def-995c-79ff0a484599</guid>
      <link>http://blog.kineticweb.com/articles/2008/03/26/request-xhr-is-only-for-prototype#comment-247</link>
    </item>
    <item>
      <title>"request.xhr? is only for Prototype?" by Randy</title>
      <description>I was going to say that I follow this:

&lt;a href="http://ozmm.org/posts/jquery_and_respond_to.html" rel="nofollow"&gt;http://ozmm.org/posts/jquery_and_respond_to.html&lt;/a&gt;

But it looks like Jason already answered you question :-)</description>
      <pubDate>Wed, 26 Mar 2008 15:42:15 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:05e75d1b-ab82-4ac8-96c3-623bff39c24d</guid>
      <link>http://blog.kineticweb.com/articles/2008/03/26/request-xhr-is-only-for-prototype#comment-243</link>
    </item>
    <item>
      <title>"request.xhr? is only for Prototype?" by JHill</title>
      <description>jQuery sets it, too.</description>
      <pubDate>Wed, 26 Mar 2008 14:21:23 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:4446d311-8e2f-42a6-bf0b-730d8b1345a9</guid>
      <link>http://blog.kineticweb.com/articles/2008/03/26/request-xhr-is-only-for-prototype#comment-242</link>
    </item>
  </channel>
</rss>
