Extending C++ Hello world addon example for node.js

I finally managed to get the C++ Hello world example working on the command line from the node.js documentation: http://nodejs.org/api/addons.html

when I run 'node hello.js' from the command line I obtain the expected results. However, I thought about extending this simple example and instead of having something print on the command line, have the string print something on a webpage.

So, I created an index.html file:

<!DOCTYPE html>
<html>
<head>

</head>

<body>

<p>When you click "Try it", a function will be called.</p>
<p>The function will display a message.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script src= ".hello.js"></script>

</body>
</html>

I then updated the hello.js file from what is given in the link to:

var addon = require('./build/Release/hello');

function myFunction() {
   document.getElementById("demo").innerHTML = addon.hello();
}

As you can see, my aim is that once the button is clicked it should trigger the 'myFunction' method and print something on the page. However, it does not work, and I'm unsure what I should be inserting.

Basically, this question is about how to pass data from a C++ function to a webpage via node.js.

Here is the hello.cc file:

#include <node.h>
#include <v8.h>

using namespace v8;

Handle<Value> Method(const Arguments& args) {
   HandleScope scope;
   return scope.Close(String::New("world"));
}

void init(Handle<Object> exports) {
  exports->Set(String::NewSymbol("hello"),
      FunctionTemplate::New(Method)->GetFunction());
}

NODE_MODULE(hello, init)