I'm creating a small Windows Sidebar Gadget for taking notes in a simple textarea
.
I have, as usual, a gadget.xml
manifest file and a .html
file, see below.
How is it possible to read some data / save some data in a Gadget?
I know this is usually impossible with JavaScript only (note: using localstorage
is not possible because I want persistance of data), so how to save/read data inside a Windows Gadget
?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
<title>NeverForget</title>
<style type="text/css">
body
{
margin: 0;
width: 300px;
height: 200px;
background-color: transparent;
}
#gadgetContent
{
width: 100%;
height: 100%;
overflow: hidden;
border: none;
background-color: transparent;
}
</style>
<script type="text/jscript" language="jscript">
function init() {
// how to load notes from a file here on startup?
}
window.onkeydown = function () {
// how to save data to file?
}
</script>
</head>
<body onload="init()">
<textarea id="gadgetContent">Bonjour</textarea>
</body>
</html>