I was wondering about the syntax of running external .js files, when you do it normally you just do
<script src=http://www.example.com/javascript.js></script>
but when running code in chrome (through the url bar), where the syntax is:
javascript:javascriptcodegoeshere
The <script> tags aren't included, so how can you launch a js file through using that?
<script>is HTML. The tags tell the browser that the text inside is to be interpreted as JavaScript. What you put in the address bar is a URI. Thejavascript:URI is not standardized but browsers simply interpret everything following the protocol as JavaScript. Those two are totally different things and ways to "tell" the browser about JavaScript code (although usingjavascript:URIs became a bad practice).