2

I'm trying to build a single page application that can be viewed offline, and that can be packaged (preferably as an HTML page), and emailed out. It needs to be able to load from the file I email out, but not hit a server at all on load time. It can load JS libraries from their servers, but the page itself will not be hosted anywhere.

This seems like a simple problem, but I'm having trouble exporting my current spa site into a static format that can be emailed.

Currently the site is built in ASP.NET MVC 4 as a WebAppSPA. The application is a bunch of graphs built from data in a JSON file.

Thanks in advance for the help!

Chris Ubick
  • 123
  • 11
  • The problem is that in chrome and maybe other browsers it might not let you load javascript files and/or make ajax calls to local templates from the file system without running the browser with a flag. http://stackoverflow.com/questions/4270999/google-chrome-allow-file-access-from-files-disabled-for-chrome-beta-8 – lucuma Jun 10 '14 at 21:03
  • 1
    I made a rather large single page offline (loaded from filesystem) HTML5 app that loaded the JS and CSS fine. Internet Explorer would not let me use LocalStorage at all, but otherwise this was just fine. What exactly are you running into trouble with? I was able to store everything in cookie/localstorage and it worked like a champ to be honest. (Except ie). Your links should look normal and reference below the current directory e.g. src='js/foo.s' – Yablargo Jun 10 '14 at 21:08
  • Thanks for the fast responses! Iucuma - As far as loading javascript libraries it's fine if those have to hit a server. I'm just not hosting anything so all the other data needs to be offline in one html file. Yablargo - that's good to know. I'll just need to figure out how to get the app into a single html page – Chris Ubick Jun 10 '14 at 21:37
  • 1
    I went with node-webkit to build the app with angularJS rather than the .NET route. Couldn't find an easy way to use .NET web technology with the file protocol. – Chris Ubick Jun 19 '14 at 23:26
  • https://github.com/rogerwang/node-webkit – Chris Ubick Jun 20 '14 at 23:19

0 Answers0