<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Masbha&#039;s Blog</title>
	<atom:link href="http://masbha.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://masbha.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 27 Sep 2011 13:27:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='masbha.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Masbha&#039;s Blog</title>
		<link>http://masbha.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://masbha.wordpress.com/osd.xml" title="Masbha&#039;s Blog" />
	<atom:link rel='hub' href='http://masbha.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Ajax response using json</title>
		<link>http://masbha.wordpress.com/2009/12/13/ajax-response-using-json/</link>
		<comments>http://masbha.wordpress.com/2009/12/13/ajax-response-using-json/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 14:41:07 +0000</pubDate>
		<dc:creator>masbha</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://masbha.wordpress.com/?p=41</guid>
		<description><![CDATA[If you use ajax response as a JSON in test.php file you will write<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=masbha.wordpress.com&amp;blog=8470791&amp;post=41&amp;subd=masbha&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>If you use ajax response as a JSON</strong><br />
<pre class="brush: xml;">
&lt;html&gt;
	&lt;head&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
		function testAjax() {
			var ajaxRequest;  // The variable that makes Ajax possible!
			try {
				// Opera 8.0+, Firefox, Safari
				ajaxRequest = new XMLHttpRequest();
			}
			catch (e) {
				// Internet Explorer Browsers
				try {
					ajaxRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
				}
				catch (e) {
					try {
						ajaxRequest = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
					}
					catch (e) {
						// Something went wrong
						alert(&quot;Your browser broke!&quot;);
						return false;
					}
				}
			}
			ajaxRequest.onreadystatechange = function() {
				if(ajaxRequest.readyState == 4) {
					var result=eval('(' + ajaxRequest.responseText + ')');
					alert(result.fname);
				}
			}
			var queryString = 'test.php';
			ajaxRequest.open(&quot;GET&quot;,queryString, true);
			ajaxRequest.send(null);
		}
	&lt;/script&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;input type=&quot;button&quot; name=&quot;view&quot; value=&quot;show&quot; onclick=&quot;testAjax();&quot;&gt;
	&lt;/body&gt;
&lt;/html&gt;
</pre><br />
in test.php file you will write<br />
<pre class="brush: php;">
&lt;?php 
echo '{&quot;fname&quot;:&quot;Brian&quot;, &quot;lname&quot;:&quot;Chess&quot;, &quot;phone&quot;:&quot;6502135600&quot;,
&quot;purchases&quot;:60000.00, &quot;email&quot;:&quot;brian@fortifysoftware.com&quot; }';
?&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/masbha.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/masbha.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/masbha.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/masbha.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/masbha.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/masbha.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/masbha.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/masbha.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/masbha.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/masbha.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/masbha.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/masbha.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/masbha.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/masbha.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=masbha.wordpress.com&amp;blog=8470791&amp;post=41&amp;subd=masbha&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://masbha.wordpress.com/2009/12/13/ajax-response-using-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49edf7be596ae6c996ecda11ce2d2052?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">masbha</media:title>
		</media:content>
	</item>
		<item>
		<title>Ajax response using xml</title>
		<link>http://masbha.wordpress.com/2009/12/13/ajax-response-using-xml/</link>
		<comments>http://masbha.wordpress.com/2009/12/13/ajax-response-using-xml/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 14:14:02 +0000</pubDate>
		<dc:creator>masbha</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[xml response]]></category>

		<guid isPermaLink="false">http://masbha.wordpress.com/?p=33</guid>
		<description><![CDATA[The server returns this XML document: To show the response we need to create a div with id=writeroot before sending the response from server you need to use header(&#8216;content-type:text/xml&#8217;)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=masbha.wordpress.com&amp;blog=8470791&amp;post=33&amp;subd=masbha&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong> The server returns this XML document:</strong><br />
<pre class="brush: xml;">
&lt;books&gt;
    &lt;book&gt;
       &lt;title&gt;JavaScript, the Definitive Guide&lt;/title&gt;
       &lt;publisher&gt;O'Reilly&lt;/publisher&gt;
       &lt;author&gt;David Flanagan&lt;/author&gt;
       &lt;cover src=&quot;/images/cover_defguide.jpg&quot; &gt;
    &lt;/book&gt;
    &lt;book&gt;
        &lt;title&gt;DOM Scripting&lt;/title&gt;
        &lt;publishe&gt;Friends of Ed&lt;/publisher&gt;
        &lt;author&gt;Jeremy Keith&lt;/author&gt;
        &lt;cover src=&quot;/images/cover_domscripting.jpg&quot; /&gt;
    &lt;/book&gt;
    &lt;book&gt;
        &lt;title&gt;DHTML Utopia: Modern Web Design using JavaScript DOM&lt;/title&gt;
        &lt;publisher&gt;Sitepoint&lt;/publishe&gt;
        &lt;author&gt;Stuart Langridge&lt;/author&gt;
        &lt;cover src=&quot;/images/cover_utopia.jpg&quot; /&gt;   
    &lt;/book&gt;
&lt;/books&gt;

</pre></p>
<h4><strong>To show the response we need to create a div with id=writeroot</strong></h4>
<p><pre class="brush: xml;">
&lt;html&gt;
	&lt;head&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
		function testAjax() {
			var ajaxRequest;  // The variable that makes Ajax possible!
		 	try {
		 		// Opera 8.0+, Firefox, Safari
		 		ajaxRequest = new XMLHttpRequest();
	 		}
		 	catch (e) {
		 		// Internet Explorer Browsers
		 		try {
		 			ajaxRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
		 		}
		 		catch (e) {
		 		try {
		 			ajaxRequest = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
		 		}
		 		catch (e) {
		 			// Something went wrong
		 			alert(&quot;Your browser broke!&quot;);
		 			return false;
		 		}
	 		}
		 }
		 ajaxRequest.onreadystatechange = function() {
		 	if(ajaxRequest.readyState == 4) { 
		 		var books = ajaxRequest.responseXML.getElementsByTagName('book');
		 		for (var i = 0; i &lt; books.length; i++) {
					var x = document.createElement('div');
					x.className = 'book';
					x.style.backgroundColor='#00FFFF';
					x.style.paddingLeft='50px';
					var y = document.createElement('h3');
					y.appendChild(document.createTextNode(getNodeValue(books[i],'title')));
					x.appendChild(y);
					var z = document.createElement('p');
					z.className = 'moreInfo';
					z.appendChild(document.createTextNode('By ' + getNodeValue(books[i],'author') + ', ' + getNodeValue(books[i],'publisher')));
					x.appendChild(z);
					var a = document.createElement('img');
					a.src = books[i].getElementsByTagName('cover')[0].getAttribute('src');
					x.appendChild(a);
					var b = document.createElement('p');
					b.appendChild(document.createTextNode(getNodeValue(books[i],'blurb')));
					x.appendChild(b);
					document.getElementById('writeroot').appendChild(x);
		 		}
		 	}
		 }
		 var queryString = 'test.php'; 
		 ajaxRequest.open(&quot;GET&quot;,queryString, true);
		 ajaxRequest.send(null); 
	}
	function getNodeValue(obj,tag)
	{
	 return obj.getElementsByTagName(tag)[0].firstChild.nodeValue;
	}
	&lt;/script&gt;
	&lt;/head&gt;
        &lt;body&gt;
        &lt;div id=&quot;writeroot&quot;&gt;
        &lt;/div&gt;
   &lt;input type=&quot;button&quot; name=&quot;view&quot; value=&quot;show&quot; onclick = &quot;testAjax();&quot;&gt;
       &lt;/body&gt;
&lt;/html&gt;
</pre><br />
<strong>before sending the response from server you need to use header(&#8216;content-type:text/xml&#8217;)<br />
</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/masbha.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/masbha.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/masbha.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/masbha.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/masbha.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/masbha.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/masbha.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/masbha.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/masbha.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/masbha.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/masbha.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/masbha.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/masbha.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/masbha.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=masbha.wordpress.com&amp;blog=8470791&amp;post=33&amp;subd=masbha&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://masbha.wordpress.com/2009/12/13/ajax-response-using-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49edf7be596ae6c996ecda11ce2d2052?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">masbha</media:title>
		</media:content>
	</item>
		<item>
		<title>Sending Ajax Request in Get or Post Method</title>
		<link>http://masbha.wordpress.com/2009/12/13/sending-ajax-request-in-get-or-post-method/</link>
		<comments>http://masbha.wordpress.com/2009/12/13/sending-ajax-request-in-get-or-post-method/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 06:45:31 +0000</pubDate>
		<dc:creator>masbha</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[How to send ajax request using POST]]></category>
		<category><![CDATA[POST]]></category>

		<guid isPermaLink="false">http://masbha.wordpress.com/?p=25</guid>
		<description><![CDATA[Making Ajax Request using GET or POST method<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=masbha.wordpress.com&amp;blog=8470791&amp;post=25&amp;subd=masbha&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>if you want to send Ajax GET Request</strong></p>
<p><pre class="brush: jscript;">

function testAjax() {
    var ajaxRequest;  // The variable that makes Ajax possible!
    var id=document.getElementById('test').value;
     try {
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer Browsers
    try {
        ajaxRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
    }
    catch (e) {
        try {
           ajaxRequest = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
       }
    catch (e) {
        // Something went wrong
        alert(&quot;Your browser broke!&quot;);
        return false;
    }
  }
}

ajaxRequest.onreadystatechange = function() {
     if(ajaxRequest.readyState == 4) {
          var result = ajaxRequest.responseText;
          // if response will be in xml format then u need to use
         //var result=ajaxRequest.responseXML;
       }
}
var queryString = 'test.php?id=5';
ajaxRequest.open(&quot;GET&quot;,queryString, true); // sending ajax request to test.php file
ajaxRequest.send(null);
}

 </pre></p>
<p><strong><br />
In test.php file if you echo $_GET['id'] you will get 5 as a response</strong><br />
<strong><br />
If you using ajax post request then </strong><br />
<pre class="brush: jscript;">
function testAjax() {
    var ajaxRequest;  // The variable that makes Ajax possible!
    var id=document.getElementById('test').value;
    try {
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer Browsers
        try {
            ajaxRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
        }
        catch (e) {
        try {
            ajaxRequest = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
        }
        catch (e) {
           // Something went wrong
           alert(&quot;Your browser broke!&quot;);
           return false;
        }
    }
}

ajaxRequest.onreadystatechange = function() {
    if(ajaxRequest.readyState == 4) {
         var result = ajaxRequest.responseText;
         // if response will be in xml format then u need to use
         //var result=ajaxRequest.responseXML;
    }
}
var queryString = 'test.php';
var params = 'id=5';
ajaxRequest.open(&quot;POST&quot;,queryString,true);
ajaxRequest.setRequestHeader(&quot;Content-type&quot;, &quot;application/x-www-form-urlencoded&quot;);
ajaxRequest.setRequestHeader(&quot;Content-length&quot;, params.length);
ajaxRequest.setRequestHeader(&quot;Connection&quot;, &quot;close&quot;);
ajaxRequest.send(params);
}
 </pre><br />
<strong><br />
In test.php file if you echo $_POST['id'] you will get 5 as a response<br />
</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/masbha.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/masbha.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/masbha.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/masbha.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/masbha.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/masbha.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/masbha.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/masbha.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/masbha.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/masbha.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/masbha.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/masbha.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/masbha.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/masbha.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=masbha.wordpress.com&amp;blog=8470791&amp;post=25&amp;subd=masbha&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://masbha.wordpress.com/2009/12/13/sending-ajax-request-in-get-or-post-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49edf7be596ae6c996ecda11ce2d2052?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">masbha</media:title>
		</media:content>
	</item>
		<item>
		<title>20+ PHP Tutorials &amp; Resources</title>
		<link>http://masbha.wordpress.com/2009/10/08/20-php-tutorials-resources/</link>
		<comments>http://masbha.wordpress.com/2009/10/08/20-php-tutorials-resources/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 09:39:43 +0000</pubDate>
		<dc:creator>masbha</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://masbha.wordpress.com/?p=8</guid>
		<description><![CDATA[There are good tips for php beginner http://nikhilmisal.com<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=masbha.wordpress.com&amp;blog=8470791&amp;post=8&amp;subd=masbha&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are good tips for php beginner <a href="http://nikhilmisal.com/2009/09/29/20-php-tutorials-resources/" target="_blank">http://nikhilmisal.com</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/masbha.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/masbha.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/masbha.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/masbha.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/masbha.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/masbha.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/masbha.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/masbha.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/masbha.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/masbha.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/masbha.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/masbha.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/masbha.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/masbha.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=masbha.wordpress.com&amp;blog=8470791&amp;post=8&amp;subd=masbha&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://masbha.wordpress.com/2009/10/08/20-php-tutorials-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49edf7be596ae6c996ecda11ce2d2052?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">masbha</media:title>
		</media:content>
	</item>
	</channel>
</rss>
