<?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: How to Make AJAX Requests With Raw JavaScript: Part 2</title>
	<atom:link href="http://net.tutsplus.com/videos/screencasts/how-to-make-ajax-requests-with-raw-javascript-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/</link>
	<description>Web Development &#38; Design Tutorials</description>
	<lastBuildDate>Sat, 20 Mar 2010 12:18:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gerome</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-134191</link>
		<dc:creator>Gerome</dc:creator>
		<pubDate>Fri, 20 Nov 2009 17:03:13 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-134191</guid>
		<description>Hi,

Would anyone be able to help, I want to turn Jeffrey&#039;s example into  a multi-page form.  I need to build a survey with various question and answer pages.

My method would be to pass the Last ID created by the insert statement on the first (start) page into a session variable in the second page and then use that session variable to update (via an update stmt statement) that particular id&#039;s record fields.  

I have managed to create the stmt statement for the insert however, I am having trouble creating a stmt statement for the update query, which references the id stored in the session variable.

Would anyone be able to help please.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Would anyone be able to help, I want to turn Jeffrey&#8217;s example into  a multi-page form.  I need to build a survey with various question and answer pages.</p>
<p>My method would be to pass the Last ID created by the insert statement on the first (start) page into a session variable in the second page and then use that session variable to update (via an update stmt statement) that particular id&#8217;s record fields.  </p>
<p>I have managed to create the stmt statement for the insert however, I am having trouble creating a stmt statement for the update query, which references the id stored in the session variable.</p>
<p>Would anyone be able to help please.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: myName</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-82921</link>
		<dc:creator>myName</dc:creator>
		<pubDate>Tue, 21 Jul 2009 23:43:51 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-82921</guid>
		<description>What about: $result = &quot;[ &quot; . implode( &quot;,&quot;, $construct ) . &quot; ]&quot;; ? Thats easier than the if(...) echo &quot;,&quot; ...</description>
		<content:encoded><![CDATA[<p>What about: $result = &#8220;[ " . implode( ",", $construct ) . " ]&#8220;; ? Thats easier than the if(&#8230;) echo &#8220;,&#8221; &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Temecula</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-78992</link>
		<dc:creator>Brian Temecula</dc:creator>
		<pubDate>Sat, 11 Jul 2009 23:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-78992</guid>
		<description>I&#039;ve never used JSON before, but it does seem pretty handy for returning data from the database. If there was a double quote in the data, would the json_encode function automatically escape it? I&#039;m also wondering if there is a better way to return data. Text, CSV, XML could be used, but in the end I guess it comes down to what is parsing on the client side. Is JSON fastest/best?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never used JSON before, but it does seem pretty handy for returning data from the database. If there was a double quote in the data, would the json_encode function automatically escape it? I&#8217;m also wondering if there is a better way to return data. Text, CSV, XML could be used, but in the end I guess it comes down to what is parsing on the client side. Is JSON fastest/best?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-75330</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Mon, 29 Jun 2009 03:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-75330</guid>
		<description>A suggestion for this video:
in the PHP script, have the &quot;Content-Type&quot; header be &quot;text/javascript&quot;, like &quot;header(&#039;Content-Type: text/javascript&#039;);&quot;

A suggestion for the next video:
How to use XML for the data instead if JSON.</description>
		<content:encoded><![CDATA[<p>A suggestion for this video:<br />
in the PHP script, have the &#8220;Content-Type&#8221; header be &#8220;text/javascript&#8221;, like &#8220;header(&#8216;Content-Type: text/javascript&#8217;);&#8221;</p>
<p>A suggestion for the next video:<br />
How to use XML for the data instead if JSON.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-73037</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Fri, 19 Jun 2009 18:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-73037</guid>
		<description>Thanks for showing the innards! I really enjoyed both of the videos, clear and precise instruction. 
&lt;- new fan</description>
		<content:encoded><![CDATA[<p>Thanks for showing the innards! I really enjoyed both of the videos, clear and precise instruction.<br />
&lt;- new fan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HJaber</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-/#comment-69643</link>
		<dc:creator>HJaber</dc:creator>
		<pubDate>Thu, 04 Jun 2009 23:53:11 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-69643</guid>
		<description>I should have commented the code, but I wanted to explain something regarding the 2 for loops at the end of the script. Coldfusion returns DATA and COLUMNS and does not return the JSON in the format the script expected. I seen an example a long time ago on Ray Camden&#039;s website where he showed how to convert the Query into a JSON string for Javascript. I thought it was a good technique and went with it for my example.</description>
		<content:encoded><![CDATA[<p>I should have commented the code, but I wanted to explain something regarding the 2 for loops at the end of the script. Coldfusion returns DATA and COLUMNS and does not return the JSON in the format the script expected. I seen an example a long time ago on Ray Camden&#8217;s website where he showed how to convert the Query into a JSON string for Javascript. I thought it was a good technique and went with it for my example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HJaber</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-69641</link>
		<dc:creator>HJaber</dc:creator>
		<pubDate>Thu, 04 Jun 2009 23:47:47 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-69641</guid>
		<description>I just wanted to post an emails.cfm and index.cfm for those who are interested in a Coldfusion version. You will have to create a db with the same fields as in Jeff&#039;s tutorial in order for this to work.

index.cfm


	
		INSERT INTO contactInfo (name,email)
		VALUES (,)
	





    
        
        
        
    

    
        

        

    
      Add New
      
        
        
        
      
    

        

			function load(url, callback) {
				var xhr;
			
				if(typeof XMLHttpRequest !== &#039;undefined&#039;) xhr = new XMLHttpRequest();
				else {
					var versions = [&quot;Microsoft.XmlHttp&quot;,
						&quot;MSXML2.XmlHttp&quot;,
						&quot;MSXML2.XmlHttp.3.0&quot;,
						&quot;MSXML2.XmlHttp.4.0&quot;,
						&quot;MSXML2.XmlHttp.5.0&quot;];
			
					for(var i = 0, len = versions.length; i &lt; len; i++) {
						try {
							xhr = new ActiveXObject(versions[i]);
							break;
						}
						catch(e){}
					} // end for
				}
			
				xhr.onreadystatechange = function() {
					if((xhr.readyState &lt; 4) &#124;&#124; xhr.status !== 200) return;
					callback(xhr);
				};
			
				xhr.open(&#039;GET&#039;, url, true);
				xhr.send(&#039;&#039;);
			
			}
			
			
			load(&#039;emails.cfm&#039;, function(xhr) {
			 var response = JSON.parse(xhr.responseText);
			 var container = document.getElementById(&#039;container&#039;);
			 
			 var vals = response.DATA;
			 var cols = response.COLUMNS;
			 
			 var colMap = new Object();
			 
			 for(var i = 0, len = cols.length; i &lt; len; i++){
			 	colMap[cols[i]] = i;
			 }
			 
			 for(var i = 0, len = vals.length; i &lt; len; i++){
			 	container.innerHTML += &#039;&lt;strong&gt;&#039; + vals[i][colMap[&quot;NAME&quot;]] + &#039;&lt;/strong&gt; : &#039; + vals[i][colMap[&quot;EMAIL&quot;]] + &#039;&#039;;
			 }
			
			});



        

    



emails.cfm


	
	
		SELECT * FROM contactInfo
	
	

#getEmails()#</description>
		<content:encoded><![CDATA[<p>I just wanted to post an emails.cfm and index.cfm for those who are interested in a Coldfusion version. You will have to create a db with the same fields as in Jeff&#8217;s tutorial in order for this to work.</p>
<p>index.cfm</p>
<p>		INSERT INTO contactInfo (name,email)<br />
		VALUES (,)</p>
<p>      Add New</p>
<p>			function load(url, callback) {<br />
				var xhr;</p>
<p>				if(typeof XMLHttpRequest !== &#8216;undefined&#8217;) xhr = new XMLHttpRequest();<br />
				else {<br />
					var versions = ["Microsoft.XmlHttp",<br />
						"MSXML2.XmlHttp",<br />
						"MSXML2.XmlHttp.3.0",<br />
						"MSXML2.XmlHttp.4.0",<br />
						"MSXML2.XmlHttp.5.0"];</p>
<p>					for(var i = 0, len = versions.length; i &lt; len; i++) {<br />
						try {<br />
							xhr = new ActiveXObject(versions[i]);<br />
							break;<br />
						}<br />
						catch(e){}<br />
					} // end for<br />
				}</p>
<p>				xhr.onreadystatechange = function() {<br />
					if((xhr.readyState &lt; 4) || xhr.status !== 200) return;<br />
					callback(xhr);<br />
				};</p>
<p>				xhr.open(&#8216;GET&#8217;, url, true);<br />
				xhr.send(&#8221;);</p>
<p>			}</p>
<p>			load(&#8216;emails.cfm&#8217;, function(xhr) {<br />
			 var response = JSON.parse(xhr.responseText);<br />
			 var container = document.getElementById(&#8216;container&#8217;);</p>
<p>			 var vals = response.DATA;<br />
			 var cols = response.COLUMNS;</p>
<p>			 var colMap = new Object();</p>
<p>			 for(var i = 0, len = cols.length; i &lt; len; i++){<br />
			 	colMap[cols[i]] = i;<br />
			 }</p>
<p>			 for(var i = 0, len = vals.length; i &lt; len; i++){<br />
			 	container.innerHTML += &#8216;<strong>&#8216; + vals[i][colMap["NAME"]] + &#8216;</strong> : &#8216; + vals[i][colMap["EMAIL"]] + &#8221;;<br />
			 }</p>
<p>			});</p>
<p>emails.cfm</p>
<p>		SELECT * FROM contactInfo</p>
<p>#getEmails()#</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keleo</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-69430</link>
		<dc:creator>Keleo</dc:creator>
		<pubDate>Thu, 04 Jun 2009 01:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-69430</guid>
		<description>IMO, its still way better to rely on jQuery instead of the raw javascript stuff. You can be sure that the .ajax() call works and use its result, instead of strugling around with code you do not need to know. 
Isn&#039;t that what a framework is originally made for? To keep you away from implementation questions...
Well, beside that, thanks for the tut!</description>
		<content:encoded><![CDATA[<p>IMO, its still way better to rely on jQuery instead of the raw javascript stuff. You can be sure that the .ajax() call works and use its result, instead of strugling around with code you do not need to know.<br />
Isn&#8217;t that what a framework is originally made for? To keep you away from implementation questions&#8230;<br />
Well, beside that, thanks for the tut!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffrey Way</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-69411</link>
		<dc:creator>Jeffrey Way</dc:creator>
		<pubDate>Wed, 03 Jun 2009 22:08:01 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-69411</guid>
		<description>var value = $(&#039;input:submit&#039;).val();
if(value === &#039;some string&#039;) {
 console.log(&#039;wahoo&#039;);
}

Maybe something similar to that?</description>
		<content:encoded><![CDATA[<p>var value = $(&#8216;input:submit&#8217;).val();<br />
if(value === &#8217;some string&#8217;) {<br />
 console.log(&#8216;wahoo&#8217;);<br />
}</p>
<p>Maybe something similar to that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffrey Way</title>
		<link>http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript-part-2/comment-page-1/#comment-69407</link>
		<dc:creator>Jeffrey Way</dc:creator>
		<pubDate>Wed, 03 Jun 2009 21:56:42 +0000</pubDate>
		<guid isPermaLink="false">http://net.tutsplus.com/?p=5220#comment-69407</guid>
		<description>I mean that technologies will come and go. Prototype was a the huge JS framework years ago. That&#039;s obviously not the case anymore. That&#039;s all I meant.</description>
		<content:encoded><![CDATA[<p>I mean that technologies will come and go. Prototype was a the huge JS framework years ago. That&#8217;s obviously not the case anymore. That&#8217;s all I meant.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.090 seconds -->
