<?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"
	>
<channel>
	<title>Comments on: Simple Ajax Functions - Snippets</title>
	<atom:link href="http://www.ajaxtutorial.net/index.php/2006/03/08/simple-ajax-functions-snippets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxtutorial.net/index.php/2006/03/08/simple-ajax-functions-snippets/</link>
	<description>Helping newbies learn AJAX with Tutorials</description>
	<pubDate>Thu, 09 Sep 2010 00:22:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: kj</title>
		<link>http://www.ajaxtutorial.net/index.php/2006/03/08/simple-ajax-functions-snippets/#comment-107</link>
		<dc:creator>kj</dc:creator>
		<pubDate>Sun, 24 Sep 2006 02:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxtutorial.net/?p=4#comment-107</guid>
		<description>hey the tutorial is great! this was the 1st time iv even tried doing anything like this and it was so easy to follow along....

iv managed to create a form and it works perfect in I.E.......but y wont it work in Firefox????

this is my code....any help will be much appreciated...thnkz...







Untitled Document


		var myObjectReference = createRequestObject();
		
		function createRequestObject()	{
		
				var xmlObject;
				
				try{xmlObject=new ActiveXObject("Msxml2.XMLHTTP");}
					catch (e){
						try	{ xmlObject=new ActiveXObject("Microsoft.XMLHTTP");}
							catch(f) { xmlhttp=null; }
				}
							
				if(!xmlObject&#38;&#38;typeof XMLHttpRequest!="undefined") {
					xmlObject=new XMLHttpRequest();
				}
							
				return xmlObject;
		}

				



		function sendRequestTextPost() {
				var rnd = Math.random();
				var myvalue1 = escape(document.getElementById("myvalue1").value);
				var myvalue2 = escape(document.getElementById("myvalue2").value);
				try{
					myObjectReference.open('POST','serverscript.php');
					myObjectReference.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
					myObjectReference.onReadyStateChange = handleResponseText;
					myObjectReference.send('myvalue1='+myvalue1+'&#38;myvalue2='+myvalue2+'&#38;rnd='+rnd);
				}
				catch(e){}
				finally{}
		}
					



		

		function handleResponseText(){
				try{
					if((myObjectReference.readyState == 4) &#38;&#38; (myObjectReference.status == 200)){
						var response = myObjectReference.responseText;
						document.getElementById("idforresults").innerHTML = String(response);
					}
				}
				catch(e){alert("there was an error");}
				finally{}
		}





 MY VALUE 1:
 MY VALUE 2:






------------------

serverscript.php :

</description>
		<content:encoded><![CDATA[<p>hey the tutorial is great! this was the 1st time iv even tried doing anything like this and it was so easy to follow along&#8230;.</p>
<p>iv managed to create a form and it works perfect in I.E&#8230;&#8230;.but y wont it work in Firefox????</p>
<p>this is my code&#8230;.any help will be much appreciated&#8230;thnkz&#8230;</p>
<p>Untitled Document</p>
<p>		var myObjectReference = createRequestObject();</p>
<p>		function createRequestObject()	{</p>
<p>				var xmlObject;</p>
<p>				try{xmlObject=new ActiveXObject(&#8221;Msxml2.XMLHTTP&#8221;);}<br />
					catch (e){<br />
						try	{ xmlObject=new ActiveXObject(&#8221;Microsoft.XMLHTTP&#8221;);}<br />
							catch(f) { xmlhttp=null; }<br />
				}</p>
<p>				if(!xmlObject&amp;&amp;typeof XMLHttpRequest!=&#8221;undefined&#8221;) {<br />
					xmlObject=new XMLHttpRequest();<br />
				}</p>
<p>				return xmlObject;<br />
		}</p>
<p>		function sendRequestTextPost() {<br />
				var rnd = Math.random();<br />
				var myvalue1 = escape(document.getElementById(&#8221;myvalue1&#8243;).value);<br />
				var myvalue2 = escape(document.getElementById(&#8221;myvalue2&#8243;).value);<br />
				try{<br />
					myObjectReference.open(&#8217;POST&#8217;,&#8217;serverscript.php&#8217;);<br />
					myObjectReference.setRequestHeader(&#8217;Content-Type&#8217;,'application/x-www-form-urlencoded&#8217;);<br />
					myObjectReference.onReadyStateChange = handleResponseText;<br />
					myObjectReference.send(&#8217;myvalue1=&#8217;+myvalue1+&#8217;&amp;myvalue2=&#8217;+myvalue2+&#8217;&amp;rnd=&#8217;+rnd);<br />
				}<br />
				catch(e){}<br />
				finally{}<br />
		}</p>
<p>		function handleResponseText(){<br />
				try{<br />
					if((myObjectReference.readyState == 4) &amp;&amp; (myObjectReference.status == 200)){<br />
						var response = myObjectReference.responseText;<br />
						document.getElementById(&#8221;idforresults&#8221;).innerHTML = String(response);<br />
					}<br />
				}<br />
				catch(e){alert(&#8221;there was an error&#8221;);}<br />
				finally{}<br />
		}</p>
<p> MY VALUE 1:<br />
 MY VALUE 2:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>serverscript.php :</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shwetamogadpally</title>
		<link>http://www.ajaxtutorial.net/index.php/2006/03/08/simple-ajax-functions-snippets/#comment-92</link>
		<dc:creator>Shwetamogadpally</dc:creator>
		<pubDate>Thu, 17 Aug 2006 12:29:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxtutorial.net/?p=4#comment-92</guid>
		<description>Yes really it is very nice for newbies!!!
Can u plz explore more on How it works? How to use AJAX in an Application?</description>
		<content:encoded><![CDATA[<p>Yes really it is very nice for newbies!!!<br />
Can u plz explore more on How it works? How to use AJAX in an Application?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shwetamogadpally</title>
		<link>http://www.ajaxtutorial.net/index.php/2006/03/08/simple-ajax-functions-snippets/#comment-91</link>
		<dc:creator>Shwetamogadpally</dc:creator>
		<pubDate>Thu, 17 Aug 2006 12:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxtutorial.net/?p=4#comment-91</guid>
		<description>Very nice article!!! And really usefull to newbeis.
But can u please more explore on What is AJAX?  How is it working?
How to use AJAX in an Application? :)</description>
		<content:encoded><![CDATA[<p>Very nice article!!! And really usefull to newbeis.<br />
But can u please more explore on What is AJAX?  How is it working?<br />
How to use AJAX in an Application? :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joey</title>
		<link>http://www.ajaxtutorial.net/index.php/2006/03/08/simple-ajax-functions-snippets/#comment-13</link>
		<dc:creator>joey</dc:creator>
		<pubDate>Tue, 11 Apr 2006 23:05:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxtutorial.net/?p=4#comment-13</guid>
		<description>Very nice tutorial!Very helpful!Thank you man!</description>
		<content:encoded><![CDATA[<p>Very nice tutorial!Very helpful!Thank you man!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
