<?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: Cross-Domain POST With JavaScript</title>
	<atom:link href="http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/</link>
	<description>A blog about web development, software business, and WordPress</description>
	<lastBuildDate>Tue, 22 May 2012 04:00:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: serans1</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-171301</link>
		<dc:creator>serans1</dc:creator>
		<pubDate>Sun, 10 Jul 2011 16:02:23 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-171301</guid>
		<description>Cool trick but kind of missing the point. 
you would normally want to do a post to send big data chucks (Get has very small limit) - as you have converted your params to url params along the way you have  lost this ability and left with a fancy get. 
i need to deliver big chunks of data in a post to different domain and be glad to hear if you have a solution to this.</description>
		<content:encoded><![CDATA[<p>Cool trick but kind of missing the point.<br />
you would normally want to do a post to send big data chucks (Get has very small limit) &#8211; as you have converted your params to url params along the way you have  lost this ability and left with a fancy get.<br />
i need to deliver big chunks of data in a post to different domain and be glad to hear if you have a solution to this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robb Lovell</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-165389</link>
		<dc:creator>Robb Lovell</dc:creator>
		<pubDate>Sat, 22 Jan 2011 00:41:02 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-165389</guid>
		<description>If you have access to all servers involved, put the following in the header of the reply for the page being requested in the other domain:

PHP:

header(&#039;Access-Control-Allow-Origin: *&#039;);

For example, in Drupal&#039;s xmlrpc.php code you would do this:

function xmlrpc_server_output($xml) { $xml = &#039;&#039;.&quot;\n&quot;. $xml; header(&#039;Connection: close&#039;); header(&#039;Content-Length: &#039;. strlen($xml)); header(&#039;Access-Control-Allow-Origin: *&#039;); header(&#039;Content-Type: application/x-www-form-urlencoded&#039;); header(&#039;Date: &#039;. date(&#039;r&#039;)); // $xml = str_replace(&quot;\n&quot;, &quot; &quot;, $xml);

echo $xml; exit; }

This probably creates a security problem, and you should make sure that you take the appropriate measures to verify the request.</description>
		<content:encoded><![CDATA[<p>If you have access to all servers involved, put the following in the header of the reply for the page being requested in the other domain:</p>
<p>PHP:</p>
<p>header(&#8216;Access-Control-Allow-Origin: *&#8217;);</p>
<p>For example, in Drupal&#8217;s xmlrpc.php code you would do this:</p>
<p>function xmlrpc_server_output($xml) { $xml = &#8221;.&#8221;\n&#8221;. $xml; header(&#8216;Connection: close&#8217;); header(&#8216;Content-Length: &#8216;. strlen($xml)); header(&#8216;Access-Control-Allow-Origin: *&#8217;); header(&#8216;Content-Type: application/x-www-form-urlencoded&#8217;); header(&#8216;Date: &#8216;. date(&#8216;r&#8217;)); // $xml = str_replace(&#8220;\n&#8221;, &#8221; &#8220;, $xml);</p>
<p>echo $xml; exit; }</p>
<p>This probably creates a security problem, and you should make sure that you take the appropriate measures to verify the request.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 512banque</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-165386</link>
		<dc:creator>512banque</dc:creator>
		<pubDate>Fri, 21 Jan 2011 22:10:10 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-165386</guid>
		<description>BUT the target will see your domain as referer !</description>
		<content:encoded><![CDATA[<p>BUT the target will see your domain as referer !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Help</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-62539</link>
		<dc:creator>Help</dc:creator>
		<pubDate>Thu, 08 Jul 2010 22:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-62539</guid>
		<description>Hi White Shadow, I dumped in your code hoping to make a cross domain post request but I ended up getting this error in firefox

document.getElementById(&quot;postform&quot;) is null
[Break on this error] document.getElementById(&#039;postform&#039;).submit();  

located in the php file. Any ideas on that?
Thanks this awesome code though.</description>
		<content:encoded><![CDATA[<p>Hi White Shadow, I dumped in your code hoping to make a cross domain post request but I ended up getting this error in firefox</p>
<p>document.getElementById(&#8220;postform&#8221;) is null<br />
[Break on this error] document.getElementById(&#8216;postform&#8217;).submit();  </p>
<p>located in the php file. Any ideas on that?<br />
Thanks this awesome code though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-30772</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Tue, 07 Jul 2009 21:13:59 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-30772</guid>
		<description>Hmm, I&#039;ve never seen that error before. Maybe it&#039;s something to do with the site you&#039;re trying to send the request to?</description>
		<content:encoded><![CDATA[<p>Hmm, I&#8217;ve never seen that error before. Maybe it&#8217;s something to do with the site you&#8217;re trying to send the request to?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-30771</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 07 Jul 2009 20:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-30771</guid>
		<description>&quot;Not Acceptable

An appropriate representation of the requested resource...&quot;

Any idea why i get this error? I am trying to get the code to work but keep getting it, ive enlarged the iframe to 500x500 and this error is inside, i have the php file simply as 1.php and have changed the reference to it in the script.</description>
		<content:encoded><![CDATA[<p>&#8220;Not Acceptable</p>
<p>An appropriate representation of the requested resource&#8230;&#8221;</p>
<p>Any idea why i get this error? I am trying to get the code to work but keep getting it, ive enlarged the iframe to 500&#215;500 and this error is inside, i have the php file simply as 1.php and have changed the reference to it in the script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: refresh</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-30454</link>
		<dc:creator>refresh</dc:creator>
		<pubDate>Fri, 05 Jun 2009 23:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-30454</guid>
		<description>Slight issue with your trick: on refresh or back, the browser will prompt the visitor to resend the post data. Destroying the iframe or the form after the initial POST won&#039;t make a difference.</description>
		<content:encoded><![CDATA[<p>Slight issue with your trick: on refresh or back, the browser will prompt the visitor to resend the post data. Destroying the iframe or the form after the initial POST won&#8217;t make a difference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-13197</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Thu, 11 Dec 2008 15:37:25 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-13197</guid>
		<description>I thought about doing something like that, but the assumption here is that you&#039;re interacting with an external, third-party target that isn&#039;t built to take advantage of this possibility. This whole thing would be much easier if you had control of the script that receives the POST.</description>
		<content:encoded><![CDATA[<p>I thought about doing something like that, but the assumption here is that you&#8217;re interacting with an external, third-party target that isn&#8217;t built to take advantage of this possibility. This whole thing would be much easier if you had control of the script that receives the POST.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tadaa</title>
		<link>http://w-shadow.com/blog/2008/11/20/cross-domain-post-with-javascript/comment-page-1/#comment-13196</link>
		<dc:creator>tadaa</dc:creator>
		<pubDate>Thu, 11 Dec 2008 15:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=524#comment-13196</guid>
		<description>You can even try to receive result ;) Script in the iframe can chage parent&#039;s hash in URL so.. before post, run a &quot;listener&quot; (like function called with interval) to watch #hash value, then post, PHP after post should generete a response javascript that will put result in the hash, &quot;listener&quot; function can catch it :)

there is a limitation in url length, but you can split result in smaller chunks</description>
		<content:encoded><![CDATA[<p>You can even try to receive result ;) Script in the iframe can chage parent&#8217;s hash in URL so.. before post, run a &#8220;listener&#8221; (like function called with interval) to watch #hash value, then post, PHP after post should generete a response javascript that will put result in the hash, &#8220;listener&#8221; function can catch it :)</p>
<p>there is a limitation in url length, but you can split result in smaller chunks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

