7. JavaScript Runs In A Host Environment | Complete JavaScript Tutorials

visibility 1 visualizzazioni schedule 5 anni fa timer 4:41
open_in_new Dailymotion
Now the last thing we saw in the previous definition slide is that JavaScript runs on a host environment.<br />So that means a JavaScript engine can be part where it can be executed in different environments.<br />The most well known environment is the browser.<br />Modern browsers have Javascript engines built in and they're therefore capable of executing javascript<br />code but you also can run javascript in our environments.<br />For example on the server side so write on a computer without having a browser in between so not inside<br />of a browser but simply execute code like this on your machine.<br />Now javascript was invented to run in the browser to make Web sites more dynamic to be able to change<br />things on a Web site without loading a new page you could say because javascript is able to closely<br />work together with the loaded age HTML code with CSX.<br />You can also use javascript to send back ground to DP requests so to send some behind the scenes requests<br />and fetch data without reloading the page and much much more in it will do all of that from the course.<br />Now there also are certain things javascript can't do when it runs in the browser environment though.<br />For example it can't access your local file system for security reasons because otherwise every web<br />page you visit would be able to read your file system maybe delete files on your computer ends on which<br />would be horrible of course.<br />And in general it is running in an a sandbox.<br />You can say it's not able to interact with your operating system and so on the browser gives you certain<br />things you can do in this environment and doesn't allow other things.<br />Now it's a set the browser is only one environment though the one for which javascript was invented<br />but not the only one were restricted to right now.<br />Instead the JavaScript engine Google developed V8 is the name of the engine was extracted by some people<br />to run javascript anywhere because the idea was Well if we have the engine in the browser why don't<br />we take it out of the browser and then make it available as a standalone tool which you can use to execute<br />javascript anywhere else directly on your machine.<br />And this