[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

JT

5/16/2016 3:50:00 PM

I just installed node js, and run the hello snippet.

Could someone point me to simplest possible example where a HTML file "is used to call?" a js file. Will i need a webserver, is node.js a webserver?
17 Answers

JT

5/16/2016 4:00:00 PM

0

Den måndag 16 maj 2016 kl. 17:49:40 UTC+2 skrev jonas.t...@gmail.com:
> I just installed node js, and run the hello snippet.
>
> Could someone point me to simplest possible example where a HTML file "is used to call?" a js file. Will i need a webserver, is node.js a webserver?

My goal is to make HTML5 apps from some old HTML pages with invoked java scripts, is node js the tool to do that?

The code lumps start to get big unmanagable and i thought breaking up the scripts into functionX.js called from a main would help. Is it possible?

JT

5/16/2016 4:19:00 PM

0

Den måndag 16 maj 2016 kl. 18:00:22 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 16 maj 2016 kl. 17:49:40 UTC+2 skrev jonas.t...@gmail.com:
> > I just installed node js, and run the hello snippet.
> >
> > Could someone point me to simplest possible example where a HTML file "is used to call?" a js file. Will i need a webserver, is node.js a webserver?
>
> My goal is to make HTML5 apps from some old HTML pages with invoked java scripts, is node js the tool to do that?
>
> The code lumps start to get big unmanagable and i thought breaking up the scripts into functionX.js called from a main would help. Is it possible?

Are all .js files serverside "executed on server", i want clientside "browser executed" javascript but i want to split the code/script over several files, is that possible?

JT

5/16/2016 4:41:00 PM

0

Den måndag 16 maj 2016 kl. 18:19:34 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 16 maj 2016 kl. 18:00:22 UTC+2 skrev jonas.t...@gmail.com:
> > Den måndag 16 maj 2016 kl. 17:49:40 UTC+2 skrev jonas.t...@gmail.com:
> > > I just installed node js, and run the hello snippet.
> > >
> > > Could someone point me to simplest possible example where a HTML file "is used to call?" a js file. Will i need a webserver, is node.js a webserver?
> >
> > My goal is to make HTML5 apps from some old HTML pages with invoked java scripts, is node js the tool to do that?
> >
> > The code lumps start to get big unmanagable and i thought breaking up the scripts into functionX.js called from a main would help. Is it possible?
>
> Are all .js files serverside "executed on server", i want clientside "browser executed" javascript but i want to split the code/script over several files, is that possible?

I found an example of a HTML5 app i liked, but i am not sure how it works.
Are the html5-canvas-drawing-app.js run serverside or downloaded to the client/browser and run?
How can i tell?

<!DOCTYPE html>
<html>
<head>
<title>Create HTML5 Canvas JavaScript Drawing App Example</title>
</head>
<body>
<div id="canvasDiv"></div>
<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
<script type="text/javascript" src="html5-canvas-drawing-app.js"></script>
<script type="text/javascript">
drawingApp.init();
</script>
</body>
</html>

JT

5/16/2016 4:47:00 PM

0

Den måndag 16 maj 2016 kl. 18:41:28 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 16 maj 2016 kl. 18:19:34 UTC+2 skrev jonas.t...@gmail.com:
> > Den måndag 16 maj 2016 kl. 18:00:22 UTC+2 skrev jonas.t...@gmail.com:
> > > Den måndag 16 maj 2016 kl. 17:49:40 UTC+2 skrev jonas.t...@gmail..com:
> > > > I just installed node js, and run the hello snippet.
> > > >
> > > > Could someone point me to simplest possible example where a HTML file "is used to call?" a js file. Will i need a webserver, is node.js a webserver?
> > >
> > > My goal is to make HTML5 apps from some old HTML pages with invoked java scripts, is node js the tool to do that?
> > >
> > > The code lumps start to get big unmanagable and i thought breaking up the scripts into functionX.js called from a main would help. Is it possible?
> >
> > Are all .js files serverside "executed on server", i want clientside "browser executed" javascript but i want to split the code/script over several files, is that possible?
>
> I found an example of a HTML5 app i liked, but i am not sure how it works.
> Are the html5-canvas-drawing-app.js run serverside or downloaded to the client/browser and run?
> How can i tell?
>
> <!DOCTYPE html>
> <html>
> <head>
> <title>Create HTML5 Canvas JavaScript Drawing App Example</title>
> </head>
> <body>
> <div id="canvasDiv"></div>
> <!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
> <script type="text/javascript" src="html5-canvas-drawing-app.js"></script>
> <script type="text/javascript">
> drawingApp.init();
> </script>
> </body>
> </html>

I may have an idea about what an HTML5 app is but it may be terrible wrong. It is an app starting up in the browser as a local service?

It just download the package? So what should be serverside become clientside using a localhost webservice that is started by the app?

Tim Slattery

5/16/2016 4:54:00 PM

0

jonas.thornvall@gmail.com wrote:

>Are all .js files serverside "executed on server", i want clientside
>"browser executed" javascript but i want to split the code/script
>over several files, is that possible?

All (or nearly all) javascript is shipped to the client and executed
there. You can have various chunks of code in various *.js files on
the server, so long as the HTML page references all of them.

--
Tim Slattery
tim <at> risingdove <dot> com

Luuk

5/16/2016 6:02:00 PM

0

On 16-05-16 18:00, jonas.thornvall@gmail.com wrote:
> Den måndag 16 maj 2016 kl. 17:49:40 UTC+2 skrev jonas.t...@gmail.com:
>> I just installed node js, and run the hello snippet.
>>
>> Could someone point me to simplest possible example where a HTML file "is used to call?" a js file. Will i need a webserver, is node.js a webserver?
>
> My goal is to make HTML5 apps from some old HTML pages with invoked java scripts, is node js the tool to do that?
>
> The code lumps start to get big unmanagable and i thought breaking up the scripts into functionX.js called from a main would help. Is it possible?
>

https://www.toptal.com/nodejs/why-the-hell-would-i-u...


Thomas 'PointedEars' Lahn

5/16/2016 8:20:00 PM

0

Tim Slattery wrote:

> jonas.thornvall@gmail.com wrote:
>> Are all .js files serverside "executed on server", i want clientside
>> "browser executed" javascript but i want to split the code/script
>> over several files, is that possible?
>
> All (or nearly all) javascript is shipped to the client and executed
> there. You can have various chunks of code in various *.js files on
> the server, so long as the HTML page references all of them.

There are no â??HTML pagesâ? (this is an outdated concept that has always been
underdefined at best), and *client-side* script resources can now be loaded
*on demand* in a reliable, non-blocking, and standards-compliant way. [1]
(If ECMAScript implementations in Web browsers would also implement the
â??exportâ? and â??importâ? features of ECMAScript 2015, we could be writing
script modules and have them loaded implicitly now instead of through
RequireJS [2] and similar libraries. [3])

Since the References header field is borken, presumably because Google
Groups borked the Message-ID, I cannot see if and how this pertains to
Node.js, which is a *server-side* environment based on Google V8 JavaScript
in that regard; Node.js modules are *never* â??shipped to the clientâ?. [4]

The OP should read the FAQ and learn â??How To Ask Questions The Smart Wayâ?.

The author of the precursor should read the FAQ, STFW, and update their
knowledge base before giving further advice.

__________
[1] <https://www.w3.org/TR/2014/REC-html5-20141028/scripting-1.html#the-script-e...
[2] <http://requirej...
[3] <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/...
[4] <https://nodejs.o...
--
PointedEars
FAQ: <http://PointedEars.... | SVN: <http://PointedEars.de...
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-...
Please do not cc me. / Bitte keine Kopien per E-Mail.

Aleksandro

5/16/2016 10:09:00 PM

0

On 16/05/16 16:20, Thomas 'PointedEars' Lahn wrote:
> Tim Slattery wrote:
>
>> jonas.thornvall@gmail.com wrote:
>>> Are all .js files serverside "executed on server", i want clientside
>>> "browser executed" javascript but i want to split the code/script
>>> over several files, is that possible?
>>
>> All (or nearly all) javascript is shipped to the client and executed
>> there. You can have various chunks of code in various *.js files on
>> the server, so long as the HTML page references all of them.
>
> There are no â??HTML pagesâ? (this is an outdated concept that has always been
> underdefined at best), and *client-side* script resources can now be loaded
> *on demand* in a reliable, non-blocking, and standards-compliant way. [1]
> (If ECMAScript implementations in Web browsers would also implement the
> â??exportâ? and â??importâ? features of ECMAScript 2015, we could be writing
> script modules and have them loaded implicitly now instead of through
> RequireJS [2] and similar libraries. [3])
>
> Since the References header field is borken, presumably because Google
> Groups borked the Message-ID, I cannot see if and how this pertains to
> Node.js, which is a *server-side* environment based on Google V8 JavaScript
> in that regard; Node.js modules are *never* â??shipped to the clientâ?. [4]
>
> The OP should read the FAQ and learn â??How To Ask Questions The Smart Wayâ?.
>
> The author of the precursor should read the FAQ, STFW, and update their
> knowledge base before giving further advice.
>
> __________
> [1] <https://www.w3.org/TR/2014/REC-html5-20141028/scripting-1.html#the-script-e...
> [2] <http://requirej...
> [3] <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/...
> [4] <https://nodejs.o...

As always, your daily doze of copypasta plus arrogance is always
appreciated. ;)

Tim Streater

5/16/2016 10:17:00 PM

0

In article <nhdg6r$nif$1@dont-email.me>, Aleksandro
<aleksandro@gmx.com> wrote:

>On 16/05/16 16:20, Thomas 'PointedEars' Lahn wrote:
>> Tim Slattery wrote:
>>
>>> jonas.thornvall@gmail.com wrote:
>>>> Are all .js files serverside "executed on server", i want clientside
>>>> "browser executed" javascript but i want to split the code/script
>>>> over several files, is that possible?
>>>
>>> All (or nearly all) javascript is shipped to the client and executed
>>> there. You can have various chunks of code in various *.js files on
>>> the server, so long as the HTML page references all of them.
>>
>> There are no â??HTML pagesâ? (this is an outdated concept that has always been
>> underdefined at best), and *client-side* script resources can now be loaded
>> *on demand* in a reliable, non-blocking, and standards-compliant way. [1]
>> (If ECMAScript implementations in Web browsers would also implement the
>> â??exportâ? and â??importâ? features of ECMAScript 2015, we could be writing
>> script modules and have them loaded implicitly now instead of through
>> RequireJS [2] and similar libraries. [3])
>>
>> Since the References header field is borken, presumably because Google
>> Groups borked the Message-ID, I cannot see if and how this pertains to
>> Node.js, which is a *server-side* environment based on Google V8 JavaScript
>> in that regard; Node.js modules are *never* â??shipped to the clientâ?. [4]
>>
>> The OP should read the FAQ and learn â??How To Ask Questions The Smart Wayâ?.
>>
>> The author of the precursor should read the FAQ, STFW, and update their
>> knowledge base before giving further advice.
>>
>> __________
>> [1]
>> <https://www.w3.org/TR/2014/REC-html5-20141028/scripting-1.html#the...
>> ement>
>> [2] <http://requirej...
>> [3]
>> <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/...
>> /export>
>> [4] <https://nodejs.o...
>
>As always, your daily doze of copypasta plus arrogance is always
>appreciated. ;)

Daily dose, actually, although such a dose as this would certainly
cause you to doze. :-)

--
"Once you adopt the unix paradigm, the variants cease to be a problem - you
bitch, of course, but that's because bitching is fun, unlike M$ OS's, where
bitching is required to keep your head from exploding." - S Stremler in afc

Thomas 'PointedEars' Lahn

5/17/2016 6:01:00 AM

0

Aleksandro wrote:

> [Full quote]
>
> As always, your daily doze of copypasta plus arrogance is always
> appreciated. ;)

You have not read it, have you?

--
PointedEars
FAQ: <http://PointedEars.... | SVN: <http://PointedEars.de...
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-...
Please do not cc me. / Bitte keine Kopien per E-Mail.