GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript-notes/02-running-javascript.md at master · geekysrm/javascript-notes

Expand file tree

/

02-running-javascript.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
19 lines (12 loc) · 677 Bytes
/

02-running-javascript.md

Copy path

File metadata and controls

19 lines (12 loc) · 677 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

Running JavaScript:

  • We can run JS on the browser's console by which we will have access to the page we are on.

  • Also we can run it in a script tag:

<script>console.log('Heyyy');</script>

Always try to have your script tag before the closing body tag, because we can access the HTML elements written above the script tag as they are above the JS.

  • Also, we can run JS in another file using script tag with src attribute:
<script src="relative path to js file"></script>
  • Also we can run it via Node.js - instead of running in the context of a website we run it in an actual machine. In console, run: node file.js
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.