<?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: Diving into Node.js &#8211; Very First App</title>
	<atom:link href="/2010/11/19/diving-into-node-js-very-first-app/feed/" rel="self" type="application/rss+xml" />
	<link>/2010/11/19/diving-into-node-js-very-first-app/</link>
	<description>on web development</description>
	<lastBuildDate>Fri, 26 Oct 2018 21:40:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>By: Madhav Anand</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-205360</link>
		<dc:creator><![CDATA[Madhav Anand]]></dc:creator>
		<pubDate>Wed, 03 Dec 2014 06:46:01 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-205360</guid>
		<description><![CDATA[My Ajax call to node server is not working....

Node code:
var http = require(&#039;http&#039;);
http.createServer(function (req, res) {

    console.log(&#039;Request received&#039;);

    res.writeHead(200, { 
        &#039;Content-Type&#039;: &#039;text/plain&#039;,
        &#039;Access-Control-Allow-Origin&#039;: &#039;*&#039; // implementation of CORS
    });
    req.on(&#039;data&#039;, function (chunk) {
        console.log(&#039;GOT DATA!&#039;);
    });

    res.end(&#039;{&quot;msg&quot;: &quot;OK&quot;}&#039;); // removed the &#039;callback&#039; stuff

}).listen(3004);
console.log(&#039;Server running at http://localhost:3004/&#039;);

html code:



    



    response here: fill me in


$(document).ready(function() {
    $.ajax({
        url: &#039;http://localhost:3004/&#039;,
        data: &#039;{&quot;data&quot;: &quot;TEST&quot;}&#039;,
         success: function (data) {
          	alert(&#039;hi&#039;);
        	var ret = jQuery.parseJSON(data);
            $(&#039;#lblResponse&#039;).html(ret.msg);
            console.log(&#039;Success: &#039;)
        },
        error: function (xhr, status, error) {
            console.log(&#039;Error: &#039; + error.message);
            $(&#039;#lblResponse&#039;).html(&#039;Error connecting to the server.&#039;);
        },
    });
});



]]></description>
		<content:encoded><![CDATA[<p>My Ajax call to node server is not working&#8230;.</p>
<p>Node code:<br />
var http = require(&#8216;http&#8217;);<br />
http.createServer(function (req, res) {</p>
<p>    console.log(&#8216;Request received&#8217;);</p>
<p>    res.writeHead(200, {<br />
        &#8216;Content-Type&#8217;: &#8216;text/plain&#8217;,<br />
        &#8216;Access-Control-Allow-Origin&#8217;: &#8216;*&#8217; // implementation of CORS<br />
    });<br />
    req.on(&#8216;data&#8217;, function (chunk) {<br />
        console.log(&#8216;GOT DATA!&#8217;);<br />
    });</p>
<p>    res.end(&#8216;{&#8220;msg&#8221;: &#8220;OK&#8221;}&#8217;); // removed the &#8216;callback&#8217; stuff</p>
<p>}).listen(3004);<br />
console.log(&#8216;Server running at <a href="http://localhost:3004/" rel="nofollow">http://localhost:3004/</a>&#8216;);</p>
<p>html code:</p>
<p>    response here: fill me in</p>
<p>$(document).ready(function() {<br />
    $.ajax({<br />
        url: &#8216;http://localhost:3004/&#8217;,<br />
        data: &#8216;{&#8220;data&#8221;: &#8220;TEST&#8221;}&#8217;,<br />
         success: function (data) {<br />
          	alert(&#8216;hi&#8217;);<br />
        	var ret = jQuery.parseJSON(data);<br />
            $(&#8216;#lblResponse&#8217;).html(ret.msg);<br />
            console.log(&#8216;Success: &#8216;)<br />
        },<br />
        error: function (xhr, status, error) {<br />
            console.log(&#8216;Error: &#8216; + error.message);<br />
            $(&#8216;#lblResponse&#8217;).html(&#8216;Error connecting to the server.&#8217;);<br />
        },<br />
    });<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sakthi</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-148744</link>
		<dc:creator><![CDATA[sakthi]]></dc:creator>
		<pubDate>Fri, 31 Oct 2014 12:11:51 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-148744</guid>
		<description><![CDATA[Thanks. Your blog is very useful for begginers..]]></description>
		<content:encoded><![CDATA[<p>Thanks. Your blog is very useful for begginers..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Murani</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-20244</link>
		<dc:creator><![CDATA[Kevin Murani]]></dc:creator>
		<pubDate>Tue, 24 Dec 2013 14:21:40 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-20244</guid>
		<description><![CDATA[Thanks. I was really wondering why the ajax request wasn&#039;t working.]]></description>
		<content:encoded><![CDATA[<p>Thanks. I was really wondering why the ajax request wasn&#8217;t working.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OMer mOrAn</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-18248</link>
		<dc:creator><![CDATA[OMer mOrAn]]></dc:creator>
		<pubDate>Sat, 19 Jan 2013 20:09:51 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-18248</guid>
		<description><![CDATA[I have to say that after spending a day in resolving this, i finally succeded due to this line: &quot;&#039;Access-Control-Allow-Origin&#039; : &#039;*&#039;&quot;.
That&#039;s a shame that i couldn&#039;t find it anywhere else...

Thanks.]]></description>
		<content:encoded><![CDATA[<p>I have to say that after spending a day in resolving this, i finally succeded due to this line: &#8220;&#8216;Access-Control-Allow-Origin&#8217; : &#8216;*'&#8221;.<br />
That&#8217;s a shame that i couldn&#8217;t find it anywhere else&#8230;</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Senthur</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-17790</link>
		<dc:creator><![CDATA[Senthur]]></dc:creator>
		<pubDate>Thu, 13 Dec 2012 13:05:34 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-17790</guid>
		<description><![CDATA[Thanks for articles on Node.js. It was really helpful to understand.]]></description>
		<content:encoded><![CDATA[<p>Thanks for articles on Node.js. It was really helpful to understand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-14317</link>
		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Mon, 23 May 2011 09:36:30 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-14317</guid>
		<description><![CDATA[Thanks for taking the time to write this. It was very helpful.]]></description>
		<content:encoded><![CDATA[<p>Thanks for taking the time to write this. It was very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: craig</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-14259</link>
		<dc:creator><![CDATA[craig]]></dc:creator>
		<pubDate>Tue, 19 Apr 2011 04:24:03 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-14259</guid>
		<description><![CDATA[very helpful! thanks]]></description>
		<content:encoded><![CDATA[<p>very helpful! thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sülüman</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-14258</link>
		<dc:creator><![CDATA[sülüman]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 13:11:30 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-14258</guid>
		<description><![CDATA[eywallah gardaş]]></description>
		<content:encoded><![CDATA[<p>eywallah gardaş</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SaaS</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-13552</link>
		<dc:creator><![CDATA[SaaS]]></dc:creator>
		<pubDate>Wed, 01 Dec 2010 17:25:24 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-13552</guid>
		<description><![CDATA[Good stuff, can you use this in drupal. what has to change, if anything?]]></description>
		<content:encoded><![CDATA[<p>Good stuff, can you use this in drupal. what has to change, if anything?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Foto Galeri</title>
		<link>/2010/11/19/diving-into-node-js-very-first-app/comment-page-1/#comment-13497</link>
		<dc:creator><![CDATA[Foto Galeri]]></dc:creator>
		<pubDate>Sun, 21 Nov 2010 09:34:54 +0000</pubDate>
		<guid isPermaLink="false">/?p=2066#comment-13497</guid>
		<description><![CDATA[Great Article. Thanks very much.]]></description>
		<content:encoded><![CDATA[<p>Great Article. Thanks very much.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
