This simple project demonstrates 2 AJAX functionsthat fire on button click. One receives a raw response from a JSON file, the other will re-direct to another URL (an erroneous one). The responses will be displayed on the page in JSON format.
Package/Dependecy | Description |
---|---|
express | Fast, unopinionated, minimalist web framework for node. Used to setup server. |
jQuery | Fast, small, and feature-rich JavaScript library. It makes Ajax simpler. |
Open project's root folder in Terminal/Bash and run:
npm install
In Terminal/Bash window use:
node server.js
To run the app.
Visit localhost:3009
to view the app.
helloWorld
├─ assets
│ ├─ ajaxRequest.js
│ ├─ info.json
│ └─ styles.css
├─ index.html
├─ readme.md
└─ server.js