<?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: Working with AJAX in Magento</title>
	<atom:link href="http://subesh.com.np/2009/11/working-with-ajax-in-magento/feed/" rel="self" type="application/rss+xml" />
	<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/</link>
	<description>PHP &#38; Magento Tips and Tutorials</description>
	<lastBuildDate>Fri, 27 Jan 2012 10:29:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Gerd</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-145</link>
		<dc:creator>Gerd</dc:creator>
		<pubDate>Sun, 04 Dec 2011 17:34:14 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-145</guid>
		<description>The solution for FORM_KEY problems:

The problem occurse when using the adminhtml/loader.js.
Following working code is without the loader:


var reloadurl = &#039;getUrl(&#039;yourController/yourAction/&#039;) ?&gt;&#039;;
new Ajax.Request(reloadurl, {
	method: &#039;post&#039;,
	parameters: &quot;Your parameters go here&quot;,
	onComplete: function(transport) {
		$(&#039;output-div&#039;).innerHTML = &quot;&quot;;
		$(&#039;output-div&#039;).innerHTML = transport.responseText;
	}
});</description>
		<content:encoded><![CDATA[<p>The solution for FORM_KEY problems:</p>
<p>The problem occurse when using the adminhtml/loader.js.<br />
Following working code is without the loader:</p>
<p>var reloadurl = &#8216;getUrl(&#8216;yourController/yourAction/&#8217;) ?&gt;&#8217;;<br />
new Ajax.Request(reloadurl, {<br />
	method: &#8216;post&#8217;,<br />
	parameters: &#8220;Your parameters go here&#8221;,<br />
	onComplete: function(transport) {<br />
		$(&#8216;output-div&#8217;).innerHTML = &#8220;&#8221;;<br />
		$(&#8216;output-div&#8217;).innerHTML = transport.responseText;<br />
	}<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: baldev</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-144</link>
		<dc:creator>baldev</dc:creator>
		<pubDate>Sat, 22 Oct 2011 09:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-144</guid>
		<description>Hello Subesh,
I am getting FORM_KEY not defined in the js file.
I am not getting the result in the div. only the loader is displayed.
Have I to pass form_key also with parameters?

I am on magento 1.4.2.0.

Please respond soon with a solution, I will be thankful to you.</description>
		<content:encoded><![CDATA[<p>Hello Subesh,<br />
I am getting FORM_KEY not defined in the js file.<br />
I am not getting the result in the div. only the loader is displayed.<br />
Have I to pass form_key also with parameters?</p>
<p>I am on magento 1.4.2.0.</p>
<p>Please respond soon with a solution, I will be thankful to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: baldev</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-143</link>
		<dc:creator>baldev</dc:creator>
		<pubDate>Sat, 22 Oct 2011 09:19:42 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-143</guid>
		<description>@Sreekanth
I am getting the FORM_KEY not found error and not getting results. I am on magento 1.4.2.0.
I am passing the parameter string as:

parameters:&quot;country_id=&quot; + c_id + &quot;&amp;form_key=&quot; + getFormKey(); ?&gt;,

I have tried to print this form key but nothing is printed, It is blank.
If you can help me I will be thankful.</description>
		<content:encoded><![CDATA[<p>@Sreekanth<br />
I am getting the FORM_KEY not found error and not getting results. I am on magento 1.4.2.0.<br />
I am passing the parameter string as:</p>
<p>parameters:&#8221;country_id=&#8221; + c_id + &#8220;&amp;form_key=&#8221; + getFormKey(); ?&gt;,</p>
<p>I have tried to print this form key but nothing is printed, It is blank.<br />
If you can help me I will be thankful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: baldev</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-142</link>
		<dc:creator>baldev</dc:creator>
		<pubDate>Sat, 22 Oct 2011 09:18:19 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-142</guid>
		<description>I am getting the FORM_KEY not found error and not getting results. I am on magento 1.4.2.0.
I am passing the parameter string as:

parameters:&quot;country_id=&quot; + c_id + &quot;&amp;form_key=&quot; + getFormKey(); ?&gt;,

I have tried to print this form key but nothing is printed, It is blank.
If you can help me I will be thankful.</description>
		<content:encoded><![CDATA[<p>I am getting the FORM_KEY not found error and not getting results. I am on magento 1.4.2.0.<br />
I am passing the parameter string as:</p>
<p>parameters:&#8221;country_id=&#8221; + c_id + &#8220;&amp;form_key=&#8221; + getFormKey(); ?&gt;,</p>
<p>I have tried to print this form key but nothing is printed, It is blank.<br />
If you can help me I will be thankful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: throwing knives</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-141</link>
		<dc:creator>throwing knives</dc:creator>
		<pubDate>Sun, 16 Oct 2011 12:00:23 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-141</guid>
		<description>I like concept of your post. Very creative post. Best of luck and waiting for some new ideas.</description>
		<content:encoded><![CDATA[<p>I like concept of your post. Very creative post. Best of luck and waiting for some new ideas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaidas</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-140</link>
		<dc:creator>Vaidas</dc:creator>
		<pubDate>Wed, 20 Jul 2011 07:36:17 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-140</guid>
		<description>Thanks for the post! Stumbling upon Ajax for the first time it took a while to realize where everything should go, but I got it working in the end.

After following the examples the Ajax request still wasn&#039;t completing for me in Magento 1.5.1.0. The problem turned out to be the inclusion of the adminhtml loader script:

&lt;script src=&quot;getJsUrl() ?&gt;mage/adminhtml/loader.js&quot; type=&quot;text/javascript&quot;&gt;


&lt;img src=&quot;getUrl()) ?&gt;skin/adminhtml/default/default/images/ajax-loader-tr.gif&quot; alt=&quot;__(&#039;Loading...&#039;) ?&gt;&quot;/&gt;__(&#039;Loading...&#039;) ?&gt;



If you experience similar problems, try removing the above lines from your template and change the JS to the following:

var reloadurl = &#039;getUrl(&#039;router/controller/action&#039;) ?&gt;&#039;;

new Ajax.Request(reloadurl, {
method: &#039;post&#039;,
parameters: &quot;Params_Here&quot;,
onComplete: function(transport) {

$(&#039;output-div&#039;).innerHTML = &quot;&quot;;
$(&#039;output-div&#039;).innerHTML = transport.responseText;

}
});</description>
		<content:encoded><![CDATA[<p>Thanks for the post! Stumbling upon Ajax for the first time it took a while to realize where everything should go, but I got it working in the end.</p>
<p>After following the examples the Ajax request still wasn&#8217;t completing for me in Magento 1.5.1.0. The problem turned out to be the inclusion of the adminhtml loader script:</p>
<p>&lt;script src=&quot;getJsUrl() ?&gt;mage/adminhtml/loader.js&#8221; type=&#8221;text/javascript&#8221;&gt;</p>
<p>&lt;img src=&quot;getUrl()) ?&gt;skin/adminhtml/default/default/images/ajax-loader-tr.gif&#8221; alt=&#8221;__(&#8216;Loading&#8230;&#8217;) ?&gt;&#8221;/&gt;__(&#8216;Loading&#8230;&#8217;) ?&gt;</p>
<p>If you experience similar problems, try removing the above lines from your template and change the JS to the following:</p>
<p>var reloadurl = &#8216;getUrl(&#8216;router/controller/action&#8217;) ?&gt;&#8217;;</p>
<p>new Ajax.Request(reloadurl, {<br />
method: &#8216;post&#8217;,<br />
parameters: &#8220;Params_Here&#8221;,<br />
onComplete: function(transport) {</p>
<p>$(&#8216;output-div&#8217;).innerHTML = &#8220;&#8221;;<br />
$(&#8216;output-div&#8217;).innerHTML = transport.responseText;</p>
<p>}<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wouter</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-139</link>
		<dc:creator>Wouter</dc:creator>
		<pubDate>Thu, 02 Jun 2011 08:38:59 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-139</guid>
		<description>By default the loader appears whenever you do a Ajax.request in adminhtml.

Is there a simple way to do an Ajax request in adminhtml, without triggering the loader?

I can remove the loader.js, but then it&#039;s removed for all requests. There are only a few non-essential requests I want to make, that should go unnoticed.

Thanks in advance</description>
		<content:encoded><![CDATA[<p>By default the loader appears whenever you do a Ajax.request in adminhtml.</p>
<p>Is there a simple way to do an Ajax request in adminhtml, without triggering the loader?</p>
<p>I can remove the loader.js, but then it&#8217;s removed for all requests. There are only a few non-essential requests I want to make, that should go unnoticed.</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-138</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 28 Apr 2011 11:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-138</guid>
		<description>Hi guys thanks for sharing amzing info,

I have a problem where if I call mage from outside magento i get an execption. Chmod of app/ect/ files I have both at 644

A very simple example will not work
load($productId);  //load the product
echo $product-&gt;getSku();//get anything you want using the typical syntax
echo $product-&gt;getPrice();
echo $product-&gt;getShortDescription();

?&gt;</description>
		<content:encoded><![CDATA[<p>Hi guys thanks for sharing amzing info,</p>
<p>I have a problem where if I call mage from outside magento i get an execption. Chmod of app/ect/ files I have both at 644</p>
<p>A very simple example will not work<br />
load($productId);  //load the product<br />
echo $product-&gt;getSku();//get anything you want using the typical syntax<br />
echo $product-&gt;getPrice();<br />
echo $product-&gt;getShortDescription();</p>
<p>?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glee kim</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-137</link>
		<dc:creator>Glee kim</dc:creator>
		<pubDate>Tue, 26 Apr 2011 14:58:42 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-137</guid>
		<description>indeed, very helpful! Magento themes are very fitting for SEO. Thanks for sharing!</description>
		<content:encoded><![CDATA[<p>indeed, very helpful! Magento themes are very fitting for SEO. Thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Robertson</title>
		<link>http://subesh.com.np/2009/11/working-with-ajax-in-magento/#comment-136</link>
		<dc:creator>Joe Robertson</dc:creator>
		<pubDate>Tue, 05 Apr 2011 14:44:36 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=82#comment-136</guid>
		<description>Instead of using a layout file (and I&#039;m not saying this is better but it can give you more control) you can output your html straight from the controller, or more commonly bundle it up in a JSON object using json_encode in php.

Something like this in your controller:

$block = $this-&gt;getLayout()
			-&gt;createBlock(&#039;blockname&#039;)-&gt;setTemplate(&#039;blocktemplate.phtml&#039;);

echo $block-&gt;renderView();

At the moment I&#039;m building a whole set of modules to bring ajax into a load of bits of Magento, hopefully it&#039;ll be really cool!</description>
		<content:encoded><![CDATA[<p>Instead of using a layout file (and I&#8217;m not saying this is better but it can give you more control) you can output your html straight from the controller, or more commonly bundle it up in a JSON object using json_encode in php.</p>
<p>Something like this in your controller:</p>
<p>$block = $this-&gt;getLayout()<br />
			-&gt;createBlock(&#8216;blockname&#8217;)-&gt;setTemplate(&#8216;blocktemplate.phtml&#8217;);</p>
<p>echo $block-&gt;renderView();</p>
<p>At the moment I&#8217;m building a whole set of modules to bring ajax into a load of bits of Magento, hopefully it&#8217;ll be really cool!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

