<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8389253794410201398</id><updated>2012-01-09T12:38:36.733+06:00</updated><category term='Ajax n JavaScript'/><title type='text'>Arshad : A crazy learner</title><subtitle type='html'>if u distribute money, it reduces; if u distribute knowledge, it increases.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://arshadinfo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8389253794410201398/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://arshadinfo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Md Arshad Hossain</name><uri>http://www.blogger.com/profile/14347744325216805519</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8389253794410201398.post-1527055805263678604</id><published>2008-09-24T16:10:00.004+06:00</published><updated>2008-09-24T16:32:16.325+06:00</updated><title type='text'>Enjoying working with cakePHP and Ext YUI for an interesting web application</title><content type='html'>From the last July 2008, I was assigned to an interesting and complex web application project (named - TMT). Its an open source web projects.&lt;br /&gt;As server side framework, I am using cakePHP and for the front side view yahoo javascript tools (Ext. YUI).&lt;br /&gt;cakePHP: yes, makes easier all the area of PHP common coding.&lt;br /&gt;Ext (YUI): Look ups are really beautiful. But, working is sort of complex for first time. Now I am really enjoying and solving all the problems and complexities of mine and my colleagues.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8389253794410201398-1527055805263678604?l=arshadinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arshadinfo.blogspot.com/feeds/1527055805263678604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8389253794410201398&amp;postID=1527055805263678604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8389253794410201398/posts/default/1527055805263678604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8389253794410201398/posts/default/1527055805263678604'/><link rel='alternate' type='text/html' href='http://arshadinfo.blogspot.com/2008/09/enjoying-working-with-cakephp-and-ext.html' title='Enjoying working with cakePHP and Ext YUI for an interesting web application'/><author><name>Md Arshad Hossain</name><uri>http://www.blogger.com/profile/14347744325216805519</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8389253794410201398.post-430380426343131354</id><published>2008-05-23T09:44:00.006+06:00</published><updated>2008-05-23T12:51:42.363+06:00</updated><title type='text'>What is the difference between asynchronous (AJAX) and synchronous request?</title><content type='html'>&lt;p class="MsoNormal"&gt;Now-a-days, this is a very common question that been asked in all most every basic interview – What is the main strength of &lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:City&gt;? Or why and when should we use &lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:City&gt; in web application?&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;And the most common answer is – “&lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:City&gt; does not refresh or reload the whole page”.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;But, the more perfect answer is – “&lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:City&gt; is an asynchronous technology where others request are synchronous.”&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So, what is the difference?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In a word, a program does not wait for response after requesting an asynchronous call whereas synchronous does so.&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;Here is a simple example – &lt;/p&gt;                  &lt;p style="color: rgb(204, 0, 0);" class="MsoNormal"&gt;function check() {&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;var a=0;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;a = getStatus(“getstatus.php?id=5”);&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;if(a==1) {&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;alert(“active”);&lt;br /&gt;            } else {&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;alert(“not active”);&lt;br /&gt;            }&lt;br /&gt;}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Here getStatus() function sends a &lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:City&gt; request to the server with “getstatus.php?id=5” url and the php file decides (from database may be) the status and output/response as 1 or 0.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;But, this function will not work properly. It will alert “not active” instead of “active”. And yes, that is for the asynchronous request.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The reason is – when a = getStatus(“getstatus.php?id=5”); line is being executed program does not wait for the response of setStatus() function. So, value of keep unchanged or set to null.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So, how should we work with asynchronous request? &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Of course, using callback function. Callback function is that function which is triggered when the request completes to get the response (or as defined).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8389253794410201398-430380426343131354?l=arshadinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arshadinfo.blogspot.com/feeds/430380426343131354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8389253794410201398&amp;postID=430380426343131354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8389253794410201398/posts/default/430380426343131354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8389253794410201398/posts/default/430380426343131354'/><link rel='alternate' type='text/html' href='http://arshadinfo.blogspot.com/2008/05/what-is-difference-between-asynchronous.html' title='What is the difference between asynchronous (AJAX) and synchronous request?'/><author><name>Md Arshad Hossain</name><uri>http://www.blogger.com/profile/14347744325216805519</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8389253794410201398.post-6478280327397992997</id><published>2008-05-02T02:43:00.003+06:00</published><updated>2008-05-07T15:31:59.384+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax n JavaScript'/><title type='text'>Ajax cache problem for requesting same URL</title><content type='html'>&lt;div&gt;&lt;/div&gt;  &lt;p class="MsoNormal"&gt;Today my colleague, Al-Amin Rubel, faces a interesting (but very common of course) problem – &lt;/p&gt;  &lt;p class="MsoNormal"&gt;“Pages are not being reloaded/ refreshed after contents are updated by &lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:city&gt;” that means &lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:city&gt; request always returns/responses same data from server although data has already been changed. But, more interesting matter is in mozilla FIREFOX is working fine whereas I.E (internet explorer) showing same output.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;After debugging a lot, it was clear that whenever request URL of &lt;st1:city&gt;&lt;st1:place&gt;ajax&lt;/st1:place&gt;&lt;/st1:city&gt; is exactly same as previous request, it loads the output from cache.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Solution:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So, perhaps the best solutions is to change the url every time. Don’t afraid, this is very simple, just add a url variable with random value using random() function.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Example:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Suppose, your &lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:city&gt; request URL is – “ajaxresponse.php?name=xyz&amp;amp;res=123”&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Then change it by adding a variable with random value – like&lt;/p&gt;  &lt;p class="MsoNormal"&gt;‘ajaxresponse.php?name=xyz&amp;amp;res=123&amp;amp;rnd=’+Math.random(10);&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;That’s it, solved!&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This is because browser takes the url as a new request (url) every time.&lt;/p&gt;  &lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8389253794410201398-6478280327397992997?l=arshadinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arshadinfo.blogspot.com/feeds/6478280327397992997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8389253794410201398&amp;postID=6478280327397992997' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8389253794410201398/posts/default/6478280327397992997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8389253794410201398/posts/default/6478280327397992997'/><link rel='alternate' type='text/html' href='http://arshadinfo.blogspot.com/2008/05/ajax-cacheing-problem-for-requesting.html' title='Ajax cache problem for requesting same URL'/><author><name>Md Arshad Hossain</name><uri>http://www.blogger.com/profile/14347744325216805519</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
