<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: AJAST &#8211; Cross-domain REST calls using JSON injection</title>
	<atom:link href="http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/feed" rel="self" type="application/rss+xml" />
	<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection</link>
	<description>Håvard Stranden&#039;s website</description>
	<lastBuildDate>Thu, 27 Oct 2011 19:33:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Håvard</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-1252</link>
		<dc:creator>Håvard</dc:creator>
		<pubDate>Tue, 08 Feb 2011 21:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-1252</guid>
		<description>&lt;p&gt;@stewart Yes, but maybe not in the way you were looking for. If you&#039;re doing AJAST against &lt;code&gt;example.com&lt;/code&gt;, the user needs to be authenticated against &lt;code&gt;example.com&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; AJAST requests can be made. AJAST itself does not provide any means of authenticating, but does honor authentications (since it uses requests sent by the browser).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@stewart Yes, but maybe not in the way you were looking for. If you&#8217;re doing AJAST against <code>example.com</code>, the user needs to be authenticated against <code>example.com</code> <em>before</em> AJAST requests can be made. AJAST itself does not provide any means of authenticating, but does honor authentications (since it uses requests sent by the browser).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: stewart</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-1250</link>
		<dc:creator>stewart</dc:creator>
		<pubDate>Tue, 08 Feb 2011 13:30:56 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-1250</guid>
		<description>&lt;p&gt;is there anyway to also use basic authentication with these commands?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>is there anyway to also use basic authentication with these commands?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Markus</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-897</link>
		<dc:creator>Markus</dc:creator>
		<pubDate>Mon, 15 Nov 2010 10:41:37 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-897</guid>
		<description>&lt;p&gt;Thanks for sharing this. Works pretty fine for me. Also thanks to the people who already sent bugfixes.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for sharing this. Works pretty fine for me. Also thanks to the people who already sent bugfixes.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Håvard</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-686</link>
		<dc:creator>Håvard</dc:creator>
		<pubDate>Wed, 17 Mar 2010 09:55:51 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-686</guid>
		<description>&lt;p&gt;Ronaldo: OX.AJAST works by sending a parameter named &#039;callback&#039; with the request. The &lt;em&gt;value&lt;/em&gt; of &#039;callback&#039; is the function name. OX.AJAST generates function names dynamically to avoid cluttering between simultaneously dispatching calls.&lt;/p&gt;

&lt;p&gt;This means that for your example, you need to accept a parameter named &#039;callback&#039; on the server side, and reply with a script that calls a function named the value of the callback parameter.&lt;/p&gt;

&lt;p&gt;In other words, &lt;code&gt;http://yourhost/resource?callback=somethingGeneratedByOxAjast&lt;/code&gt; should give &lt;code&gt;somethingGeneratedByOxAjast(someData);&lt;/code&gt; in response.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ronaldo: OX.AJAST works by sending a parameter named &#8216;callback&#8217; with the request. The <em>value</em> of &#8216;callback&#8217; is the function name. OX.AJAST generates function names dynamically to avoid cluttering between simultaneously dispatching calls.</p>

<p>This means that for your example, you need to accept a parameter named &#8216;callback&#8217; on the server side, and reply with a script that calls a function named the value of the callback parameter.</p>

<p>In other words, <code><a href="http://yourhost/resource?callback=somethingGeneratedByOxAjast" rel="nofollow">http://yourhost/resource?callback=somethingGeneratedByOxAjast</a></code> should give <code>somethingGeneratedByOxAjast(someData);</code> in response.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ronaldo</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-685</link>
		<dc:creator>Ronaldo</dc:creator>
		<pubDate>Tue, 16 Mar 2010 19:18:48 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-685</guid>
		<description>&lt;p&gt;Hi. Nice code. But its raising to me: callback is not defined. I&#039;m using OX.AJAST.call(url, &#039;callback&#039;, f1, 1000, false); and my url give me callback(&#039;data&#039;);
I need some help.
Thanks,
Ronaldo.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi. Nice code. But its raising to me: callback is not defined. I&#8217;m using OX.AJAST.call(url, &#8216;callback&#8217;, f1, 1000, false); and my url give me callback(&#8216;data&#8217;);
I need some help.
Thanks,
Ronaldo.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: IStvan</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-666</link>
		<dc:creator>IStvan</dc:creator>
		<pubDate>Wed, 10 Feb 2010 13:33:47 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-666</guid>
		<description>&lt;p&gt;Great little code. 
Is it possible to change the request headers before the call? I&#039;d like to prevent caching. I was thinking to use cache-control no-cache as request header. Please help me how to inject that.&lt;/p&gt;

&lt;p&gt;thanks,
--IStvan&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Great little code. 
Is it possible to change the request headers before the call? I&#8217;d like to prevent caching. I was thinking to use cache-control no-cache as request header. Please help me how to inject that.</p>

<p>thanks,
&#8211;IStvan</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Håvard</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-665</link>
		<dc:creator>Håvard</dc:creator>
		<pubDate>Wed, 10 Feb 2010 10:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-665</guid>
		<description>&lt;p&gt;Ali: This is weird. I suspect your issue is something else. Javascript always runs in a single thread (although the XHRs themselves are run asynchronously), so synchronization is not an issue.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ali: This is weird. I suspect your issue is something else. Javascript always runs in a single thread (although the XHRs themselves are run asynchronously), so synchronization is not an issue.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ali Salhi</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-663</link>
		<dc:creator>Ali Salhi</dc:creator>
		<pubDate>Sun, 07 Feb 2010 18:45:40 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-663</guid>
		<description>&lt;p&gt;Hi 
Great Work :D
helped me a lot with an application I am working on :D&lt;/p&gt;

&lt;p&gt;however there is a bug I would like to mention&lt;/p&gt;

&lt;p&gt;In my application I need to send like 4 to 5 requests &quot;one after the other (onload) &quot; to different servlets in a &quot;XYZ&quot; server. and since your callbackid variable is static , this will cause some unstable response and incorrect data!&lt;/p&gt;

&lt;p&gt;anyway :D ... I just changed this line:
var callbackid = &#039;callback&#039; + OX.AJAST.&lt;strong&gt;callid&lt;/strong&gt;;&lt;/p&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;p&gt;var callbackid = &#039;callback&#039; +Math.floor(Math.random()*9999999)+ OX.AJAST.&lt;strong&gt;callid&lt;/strong&gt;;&lt;/p&gt;

&lt;p&gt;thanks for this great lib :D&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi 
Great Work <img src='http://ox.no/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> 
helped me a lot with an application I am working on <img src='http://ox.no/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>

<p>however there is a bug I would like to mention</p>

<p>In my application I need to send like 4 to 5 requests &#8220;one after the other (onload) &#8221; to different servlets in a &#8220;XYZ&#8221; server. and since your callbackid variable is static , this will cause some unstable response and incorrect data!</p>

<p>anyway <img src='http://ox.no/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  &#8230; I just changed this line:
var callbackid = &#8216;callback&#8217; + OX.AJAST.<strong>callid</strong>;</p>

<p>to:</p>

<p>var callbackid = &#8216;callback&#8217; +Math.floor(Math.random()*9999999)+ OX.AJAST.<strong>callid</strong>;</p>

<p>thanks for this great lib <img src='http://ox.no/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Håvard</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-652</link>
		<dc:creator>Håvard</dc:creator>
		<pubDate>Fri, 15 Jan 2010 14:10:53 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-652</guid>
		<description>&lt;p&gt;Zohar: Thanks for the input, will fix and put up a revision soon (sorry for not providing a patched version on the site yet).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Zohar: Thanks for the input, will fix and put up a revision soon (sorry for not providing a patched version on the site yet).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Zohar Babin</title>
		<link>http://ox.no/posts/ajast-cross-domain-rest-calls-using-json-injection/comment-page-1#comment-646</link>
		<dc:creator>Zohar Babin</dc:creator>
		<pubDate>Mon, 04 Jan 2010 15:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://ox.no/posts/ajast-cross-domain-rest-calls-using-javascript-injection#comment-646</guid>
		<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;This library is great. however, I did manage to fix two things (1 is included above in the comments as well, but not fixed on the file linked from the article).&lt;/p&gt;

&lt;p&gt;Line 108:
OX.AJAST.Broker.&lt;strong&gt;callid&lt;/strong&gt;++) should be OX.AJAST.&lt;strong&gt;callid&lt;/strong&gt;++&lt;/p&gt;

&lt;p&gt;Line 123: replace the line with the following:
if (this.url.indexOf(&#039;?&#039;, 0) &gt; -1)
  this.url += &#039;&amp;&#039; + args.join(&#039;&amp;&#039;);
else
  this.url += &#039;?&#039; + args.join(&#039;&amp;&#039;);
OX.AJAST.call(this.url, this.cb, callback, this.timeout, this.jsonmode);&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,</p>

<p>This library is great. however, I did manage to fix two things (1 is included above in the comments as well, but not fixed on the file linked from the article).</p>

<p>Line 108:
OX.AJAST.Broker.<strong>callid</strong>++) should be OX.AJAST.<strong>callid</strong>++</p>

<p>Line 123: replace the line with the following:
if (this.url.indexOf(&#8216;?&#8217;, 0) &gt; -1)
  this.url += &#8216;&amp;&#8217; + args.join(&#8216;&amp;&#8217;);
else
  this.url += &#8216;?&#8217; + args.join(&#8216;&amp;&#8217;);
OX.AJAST.call(this.url, this.cb, callback, this.timeout, this.jsonmode);</p>]]></content:encoded>
	</item>
</channel>
</rss>

