How can I load a simple JavaScript file, in such a way that when a users' device is offline, the file is retrieved from the localStorage?
The file I want to load is not a Sencha Touch formatted class.
I use Sencha Cmd and added this JavaScript file (mathparser-min.js) in the app.json. The file is properly stored in the localStorage. When a user's device is offline this file must be loaded from the localStorage, just like the Sencha Touch classes that I inlcuded with 'require'.
Preferably, I want this file to be added to app.js when I use Sencha Cmd to build for production.
Just including the JavaScript file in the html head section like below does not work.
Code:
<!DOCTYPE HTML>
<html manifest="cache.appcache" lang="en-US">
<head>
<script type="text/javascript" src="mathparser-min.js"></script>
<!-- other html -->
<body></body>
</html>
Any help would be appreciated.