Emoncms auto-update and RESTful service using JSON questions

Hi,

This isn't concerning a problem with emoncms. I had some questions on how the software all functions together to get the end result. I'm in the process of creating my own RESTful service using Flask (Python). I'm trying to create a webpage that will auto-update values on the page. The Flask script is setup to query some values and then create JSON which is sent back to the client. The client in this case will be a kiosk display.

After many attempts, I did get the client to read the JSON from the Flask server. However, I think after running the browser on the page for a day, it may have crashed the browser. I'm using Chrome for development. I noticed in the Web Tools > Resources under Scripts that each time the client queries the Flask server, it creates a new JSON file. Not sure if this could be the issue I'm having or if this is bad for memory, etc.

I'm having to use JSONP to return data from the server as I kept getting errors related to http://en.wikipedia.org/wiki/Same_origin_policy if I didn't. If I don't use JSONP, I get an

Uncaught SyntaxError: Unexpected token :

errors at the second line in the json file. JSON file looks like the following:

{

"pvs": {

"index1": {

"keyname": 1

...

},

.....

}

}

 

Looking at EMONCMS in the Resources window, the JSON file is simply replaced (updated) when new data is displayed. How is this behavior achieved? What files, and parts of files, should I look at to try to make my service work? This system will be part of a kiosk where a few computers connected to monitors will load the webpage that contains the CSS and Javascript. The Javascript will send requests to the RESTful server. The returned data will then be placed into the DOM of the webpage. The javascript will also change the display kiosk as needed (such as changing colors of divs depending on returned values). In otherwords, I'm concerned that adding files to the browser resources will crash the browser/computer. The monitors will run 24/7. I'd like to make it so that they are stable and can stay running without having to worry about them.

Thanks in advance!