<?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/"
	>

<channel>
	<title>SamplePhpCodes.com &#187; ajax script demo</title>
	<atom:link href="http://www.samplephpcodes.com/tag/ajax-script-demo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.samplephpcodes.com</link>
	<description>Get PHP Code Help, Sample PHP Scripts,PHP Script Demos</description>
	<lastBuildDate>Mon, 05 Apr 2010 15:39:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Ajax examples with php</title>
		<link>http://www.samplephpcodes.com/sample-php-codes/ajax/ajax-examples-with-php/</link>
		<comments>http://www.samplephpcodes.com/sample-php-codes/ajax/ajax-examples-with-php/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 16:46:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ajax as simple function call]]></category>
		<category><![CDATA[ajax drag and drop script]]></category>
		<category><![CDATA[ajax examples with php]]></category>
		<category><![CDATA[Ajax made easy]]></category>
		<category><![CDATA[ajax script demo]]></category>
		<category><![CDATA[ajax script download]]></category>
		<category><![CDATA[ajax tabs script]]></category>
		<category><![CDATA[auction php scripts]]></category>
		<category><![CDATA[dhtml ajax scripts]]></category>
		<category><![CDATA[free ajax scripts]]></category>
		<category><![CDATA[id of the dom element to be changed]]></category>
		<category><![CDATA[pass parameter to ajax call]]></category>

		<guid isPermaLink="false">http://samplephpcodes.com/?p=71</guid>
		<description><![CDATA[Ajax is a catchy name for a type of programming made popular in 2005 by Google and other big web developers. Ajax loosely stands for Asynchronous Javascript And XML, but that just sounds like techno jargon to many people. &#60;!-- AJAX CODE BY samplephpcodes.com makeGetRequest('file.php?uid=&#60;?php echo $fid; ?&#62;',result_div_id) --&#62; &#60;!-- ++++++++++++++++++++++++++++++++++++++++ --&#62; &#60;script language=&#34;javascript&#34;&#62; function [...]]]></description>
			<content:encoded><![CDATA[<p>Ajax is a catchy name for a type of programming made popular in 2005 by Google and other big web developers. Ajax loosely stands for Asynchronous Javascript And XML, but that just sounds like techno jargon to many people.</p>
<pre class="brush: php;">
&lt;!--
AJAX CODE BY samplephpcodes.com	

makeGetRequest('file.php?uid=&lt;?php echo $fid; ?&gt;',result_div_id)

--&gt;
&lt;!-- ++++++++++++++++++++++++++++++++++++++++ --&gt;

&lt;script language=&quot;javascript&quot;&gt;

function createRequestObject() {

    var tmpXmlHttpObject;

    if (window.XMLHttpRequest) { 

        // Mozilla, Safari would use this method ...

        tmpXmlHttpObject = new XMLHttpRequest();

    } else if (window.ActiveXObject) { 

        // IE would use this method ...

        tmpXmlHttpObject = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);

    }

    return tmpXmlHttpObject;

}

var http = createRequestObject();

var out;

function makeGetRequest(url,temp) {

   	out=temp;
	var val=Math.random();

	url=url+'&amp;sid='+val;
	http.open('get', url);

	http.onreadystatechange = processResponse;

	http.send(null);

}

function processResponse() {

     if(http.readyState == 4){

        var response = http.responseText;

	    document.getElementById(out).innerHTML = response;

       }

}

&lt;/script&gt;

&lt;!-- +++++++++++++++++++++++++++++++++++++++++++++++ --&gt;
</pre>
<p>After including the following code in the head part of the html page call the followin javascript function wereru need to call you ajax request</p>
<pre class="brush: php;">

makeGetRequest('file.php?uid=&lt;?php echo $fid; ?&gt;',result_div_id)
</pre>
<p>In the above Javascript code, we try three times to make our XMLHttpRequest object. Our first attempt:</p>
<p>    * ajaxRequest = new XMLHttpRequest();</p>
<p>is for the Opera 8.0+, Firefox and Safari browsers. If that fails we try two more times to make the correct object for an Internet Explorer browser with:</p>
<p>    * ajaxRequest = new ActiveXObject(&#8220;Msxml2.XMLHTTP&#8221;);<br />
    * ajaxRequest = new ActiveXObject(&#8220;Microsoft.XMLHTTP&#8221;);></p>
<p>If that doesn&#8217;t work, then they are using a very outdated browser that doesn&#8217;t support XMLHttpRequest, which also means it doesn&#8217;t support Ajax.</p>
<p>Most likely though, our variable ajaxRequest will now be set to whatever XMLHttpRequest standard the browser uses and we can start sending data to the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.samplephpcodes.com/sample-php-codes/ajax/ajax-examples-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
