How can a page have some kind of unique identification when browsed by two instances of the same browser, on the same computer, by the same user?
Each browser will send .load’s to the server containing requests for different data for each browser.
Each of the server’s two responses to the two browsers will contain the unique ID sent in the load.
The situation:
A user browsers to my page which has a chart. The page does .loads to the server to get near real-time data for the chart.
User needs to open a second instance of the browser, to the same page, to select a different chart,
in order to watch the two charts at the same time.
The two instances of the browser each needs to send a .load requesting different data, and the .load needs to also contain a unique ID for each instance of the page.
This sounds to me more like your requests to the server should be entirely self describing and stateless. Then, if the user opens a new browser window and goes to a new chart, when the page requests data from the server for the chart, it just tells the server what chart it is interested in. No unique ID is needed at all. If you think this won’t work for you, then perhaps you need to describe why you need a unique ID so we might better know how to help.
If you feel like you must coin a unique ID, then have the server coin the ID and return it to the page. That page can keep the unique ID in it’s own javascript and then if it requests any new charts, it can pass in that unique ID. Any other page open, even if in the same browser, will have it’s own javascript storage and thus its own unique ID.
FYI, you cannot generate a 100% guaranteed unique ID on the client. If you really need a totally unique ID across the world, then you need to generate it on a common server.