Reputation: 470
I have a JavaScript code that is capturing mouse co-ordinates(X, Y and timestamps) from UI. I want to write this information into a file (xml/.txt etc.)so that it can be used for further processing using another toolkit.
Since apparently we cannot access client-side file system using JavaScript, I was looking for a way to do this. I don't have much experience with JavaScript, I tried searching and AJAX seems to be a solution. Any other solution is most welcomed.
My question is - Can we load AJAX locally so that this processing can be done without interacting with Web-server ? Since if this can be done I just need to do file handling using other code (C#) so that I can use recorded data .
I don't want to use HTML5, since I have a custom browser built on top of qt 4.6 which doesn't have support for HTML5 File API.
P.S. - I don't have any other functionality on the page, it's just a blank "index.html" that is executing a script to capture mouse co-ordinates and display them.
Upvotes: 1
Views: 2376
Reputation: 114437
The cheap-and-cheerful method is to use window.name
, which can hold a string value of several megabytes. This is not protected space and can be used by any web page's script - so it's not really "safe" for general consumption without encryption, but for hacking around it's easy, fast and convenient. Stringify your data and pop it in.
Upvotes: 1