This is my index.html code
<a href= /aoff > <button type="submit" >Force OFF</button></a>
<a href= /aon > <button type="submit" >Force ON </button></a>
and this is my server.js code
var http = require('http');
var ejs = require('ejs');
var fs = require('fs');
var system = require('child_process').exec;
var mraa = require('mraa');
var dev_1_status = "OFF";
var content = fs.readFileSync('index.html', 'utf-8');
var compiled = ejs.compile(content);
http.createServer(function(req,res) {
      var temp = 5;
        if(req.url === "/aon") {
            //pin_1.write(0);
                dev_1_status = "ON";
            console.log("pin 2 on");
        }
        if(req.url === "/aoff") {
            //pin_1.write(1);
                dev_1_status = "OFF";
            console.log("pin 2 off");
        }
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.end(compiled({temp: temp, dev_1_status:dev_1_status}));
}).listen(8080);
I just wanna use AJAX to route to /aoff or /aon without refresh the page, Any help or tutorial on using AJAX with node would be helpful.
