HTML5 Local Storage - Creating and writing to a json file? - html

We are building a web application using SVG & JS. The log file for this application needs to be created on the client side and then finally uploaded to the server once the project is ended.
As we donot wish to go near ActiveX controls, is it possible to achieve this with the new HTML5 'Local Storage'? Isnt that what 'Local Storage' is for anyways?
Is there a working example of this as well?
Many thanks,

Not really sure what you mean by this but there is something out there called jStorage.
It uses javascript and json to save data to the local database.

Related

my wepApi giving error when I try open my psd html file

I Have wepApi project but I want to use it with adobe photoshop.So I design to web site with adobe and after I convert to html file.But When I try to open it with localhost it's giving me error.But it's working on live server.
enter image description here
I never used before abode but I have to for one project.So maybe someone know what is the solution?
There are several potential causes for this problem. Here are a few potential answers:
Ensure that your local machine is running a web server. The HTML file won't be able to connect to your API without a web server.
Ensure that the URL you are using to access the HTML file is correct. The format should be "http://localhost/path/to/file.html."
Make sure your web server is operational and properly configured if you use one.
Make sure your HTML file is free of syntax mistakes. To check for issues, you can use a tool like the W3C Markup Validation Service.
I hope this is useful.

Open application with browser link

We have a web application which is used to manage a list of main records in a database via a Spring Boot Web server talking to a back-end Java Server.
We also have a JavaFX standalone application which is used to graphically manipulate sub-records of these main web records, using a similar connection to the back-end Java Server.
We want to be able to launch this JavaFX application by clicking on a link next to each of the main records in the web interface. We would like to do this as seemlessly as possible.
At the moment the only way I can think that we can do this, is to use the Browser's 'Applications' set up to associate a particular MIME file type with the standalone JavaFX application, and somehow pass the UID of the record we click on as the 'file' being 'downloaded'.
Trouble is I'm not really sure what I should be googling for, to find out about this download process. For instance, does the browser pass the 'file' in a MIME message that is passed to the application, or does it save the 'file' in a temporary directory and then call the application with the temporary file path?
Has anyone done this sort of thing before, that could give us some pointers?
I don't have a turnkey solution but I think what you are looking for is a custom URI scheme (like the Magnet URI scheme magnet:, mailto:, or tel:).
Here is an article about launching applications using custom browser protocols and here is how to register an application to a URI Scheme on Windows.
You will have to modify the Windows Registry to link your custom protocol to an application, it looks like:
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe,1"
shell
open
command
(Default) = "C:\Program Files\Alert\alert.exe" "%1"

Creating a server / service client

I have been developing an app that has to access a DB and return data has charts in a web page. since it is to be added to another software i had to create it as a local server / servce, using self host web api, returning the data as json so i can read it in my html file and create the charts.
The server / service works, but my problem remains on the client. I don't know if i have to create another project for my html or if i just add a folder with my html and all css and javascript.
Basically when i run it i have to display my html file.
I have been looking the web for examples / solutions but i can't seem to find one that will help me, i've checked:
creating help pages with T4, but it includes all my css and js files in my html and when i want to change something i have to remove the include, debug and include it again;
create a web app but when i run it it creates me 2 servers, the one i've created and the web page server, although my web page will access it using angularjs, i can't have the second server;
I'm a little lost on how i will do it.
Can someone give me some help?
I'm using VS2010, self-host WebApi, console app, entity framework, angularjs, nvd3 and d3.
thk
If you have developed your project using MVC4 you can create view/controller related to report in webapi project.Point add html files to this view.This won't create 2 servers.

What is the best way to add a Dart hello world into my existing Node.js website?

I have been reading tutorials and guides concerning this but have not found a straight forward answer to this.
I currently have an existing website running on a node.js platform, locally on my computer.
Goal: Now I want to try and write a simple hello world in Dart, export it to plain JavaScript and see it work in my existing website.
Reading the documents, I read that I should create a new "Web Application" and to create some sample code up and running, I check the "Generate sample content" box.
And my project is now created in Dart Editor:
I can run the sample in Dartium, see it work, etc.
But the problem is that I have now a .html file in the Dart-project, while I have a real .html file for my existing node website in a totally different path. I don't want that. I want to try and use the existing .html instead, since.. thats my real website.
But when trying to create a new Dartium launcher, I can only refer to .html files within my Dart-project:
So my big question is; How do actually start using Dart with my existing developed website?
How do I create that bridge?
On the second image above in your original question, there is an option just below the HTML file, called URL - is this what you're looking for? You can set that to any arbitrary URL.
You'd also need to copy the helloworld.dart file into your node.js server path, and copy the bits inside the <body> tag into your existing HTML page. You'll also need to copy the packages\browser\dart.js file somewhere to your node.js server, too.
If you wanted to run the JS version, you'd also need to use the editor menu option to Generate JavaScript and copy the .js files into your node.js server path.
The script tag that refers to dart.js automatically detects if the browser supports Dart natively, and will either load the .dart version of your app, or the .dart.js version of your app (from the same folder location).
So what you're likely after is something like:
c:/nodejs_server_root
/existingIndex.html // containing the two script tags from helloworld.html
// and other tags referred to in helloworld.dart
/helloworld.dart
/dart.js
/helloworld.dart.js
And in the "URL" path in the launch configuration, you'd put something like http://localhost:<port>/existingIndex.html
https://pub.dartlang.org/packages/dev_compiler can compile Dart to Node.js modules with the --modules=node option.
See also https://github.com/dart-lang/dev_compiler/issues/291#issuecomment-176687849

How to create HTML5 100% offline applications?

Sometimes I need to write a small program just to represent some data in a chart, or similar stuff. I have been wanting to do this kind of things through the browser, with HTML5. I think it would be nice to use its canvas to create a nice UI for simple apps.
I have read some articles related to offline applications with HTML5, but they focus on downloading all the data you need and save it to the cache to use it offline later. You even need to set up an Apache server (or similar) to create your app.
I don't need my app to be online, just in my computer. I just want to create a simple application, nothing to do with internet at all.
How can I do this? Is it even possible or worthy? Is there any "Hello world!" tutorial about this around there?
Something like Mozilla Prism would be good for displaying the content as an application.
There's no need to have a web server like Apache for just displaying HTML5/Javascript in a browser. You can just have it all in a folder on your desktop and then load it in the browser with the file:// protocol.
For example file://C:/Documents and Settings/YourUser/Desktop/YourApp/index.html would open an HTML file in a folder called YourApp on your user's desktop.
If you ever find you need to read static HTML+Javascript files locally then I'd recommend using this python command in the console:
python -m SimpleHTTPServer
It launches a simple HTTP server (who'd of guessed) that serves files from the current working directory. Effectively, it's the same as launching an apache webserver, putting some static assets in /var/www/... etc. etc.
You could also just browse to the assets at file:///some/folder; however, most browsers will prevent javascript from using AJAX when files are loaded in that way, which will manifest as a bunch of bugs when you go to load it.