How to use a custom assembly from dojo in file: /// (Cordova / Phonegap)

I am developing a web application using the dojo framework. This application must be downloaded by the browser using the file: /// protocol (it will become the Cordova / Phonegap application for Android / iPad). The index.html file looks like this:

Head section :

<script type="text/javascript">
    var dojoConfig =  {
        parseOnLoad: true
    }
</script>

<script type="text/javascript" src=""dojo.js"/>

<script type="text/javascript">
  dojo.require("dojox.mobile.parser");
  dojo.require("dojox.mobile");
</script>

Body Section:

<script type="text/javascript">
    dojo.require("dojox.mobile.parser");
    dojo.require("dojox.mobile");
</script>

This was taken from an IBM lesson ( Mobile Application Development, Part 1: PhoneGap and dojo Mobile on Android )

So there are two problems:

1) dojo tries to load modules, but could not execute it using the file: /// protocol. HTTP protocol required.

2) index.html dojo, -. , , . , , dojo.js

- , .

+4
2

? - Chrome Html. firefox, . , index.html dojo (dojo).

, . | - [dojo_source/dojo_library]
 |
 |. -index.html

://

, .

- -. - "mongoose", , 136 . dojo. -, .

0

dojo , AMD XHR, .

: http://www.sitepen.com/blog/2014/07/30/dojo-faq-why-do-i-need-to-use-an-http-server-with-dojo/

, - node js - .

, dojo.someModule, - . , .

async false config dojo.

0

Source: https://habr.com/ru/post/1541950/


All Articles