Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>When you install node.js where do you store your files so that the web browser can display your content? For example Apache have a www folder.</p> </blockquote> <p>Wherever you want. node.js doesn't serve static content, it runs JavaScript. You tell it which script to run when you start it.</p> <p>You could write some JavaScript that serves static content, but where you would keep it depends on the code you wrote.</p> <blockquote> <p>Does node.js replace client side javascript?</p> </blockquote> <p>Only in so far as any server side programming replaces client side JavaScript. </p> <p>One advantage of using JS on the server side is that you can reuse libraries on both the client and the server. See <a href="http://developer.yahoo.com/cocktails/mojito/" rel="nofollow">Mojito</a> for a framework that claims to focus on this (I haven't had time to try it myself yet).</p> <blockquote> <p>For example if I wanted to put data from the server into this div element <code>&lt;div id="content"&gt;&lt;/div&gt;</code> In PHP you could do something like this: <code>&lt;div id="content"&gt;&lt;?php echo $content; ?&gt;&lt;/div&gt;</code></p> </blockquote> <p>PHP is a template language with an embedded programming language. JavaScript is a programming language. Typically you would use a template language (e.g. <a href="http://mustache.github.com/" rel="nofollow">moustache</a>) from your JS.</p> <blockquote> <p>Would you ever call node.js from client side? For example: An Ajax request to node.js to get data.</p> </blockquote> <p>Yes, if you want to. Just like any other server side programming environment. (Assuming you are using node to run an HTTP server).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload