對於非常簡單的Cordova/Dojo應用程序,我有「unknown chromium error:-6」。 Cordova 2.9.0沒有發生這種情況?有沒有人有這個問題?如果我在桌面上運行相同的index.html,控制檯會拋出此錯誤Cordova 3.0.0 with dojo toolkit 1.9在android 4.2.2上返回「unknown chromium error:-6」
Cross origin requests are only supported for HTTP. dojo.js.uncompressed.js:308
req.getText dojo.js.uncompressed.js:308
injectModule dojo.js.uncompressed.js:1522
doRequire dojo.js.uncompressed.js:6703
dojo.require dojo.js.uncompressed.js:6740
(anonymous function) index.html:63
Does anyone encounter this problem?
My application looks like this
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" href="js/dojo-1.9.1/dojox/mobile/themes/android/android.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/index.css" />
<script type="text/javascript" src="js/dojo-1.9.1/dojo/dojo.js.uncompressed.js" djConfig="parseOnLoad:true">
<title>Hello World</title>
</head>
<body>
<!-- ACCIDENT TOOLKIT PAGE -->
<div dojoType="dojox.mobile.View" id="accHelp" selected="true">
<h1 dojoType="dojox.mobile.Heading">Accident</h1>
<div class="text">If you are in an accident, you should first move to a safe
location. Below are some additional actions you can take:</div>
<ul dojoType="dojox.mobile.RoundRectList">
<li dojoType="dojox.mobile.ListItem"
onclick="window.location='geo:0,0?q=police';">Call the Police</li>
<li dojoType="dojox.mobile.ListItem"
onclick="window.location='geo:0,0?q=towing';">Call for a Tow Truck</li>
<li dojoType="dojox.mobile.ListItem" moveTo="accInfo" transition="slide"
onClick="itemClicked();">Exchange Driver Info</li>
<li dojoType="dojox.mobile.ListItem" moveTo="accInfo" transition="slide"
onClick="itemClicked();">Record Accident Location</li>
<li dojoType="dojox.mobile.ListItem" moveTo="accInfo" transition="slide"
onClick="itemClicked();">Take Photos of Accident</li>
</ul>
</div>
<!-- EXCHANGE DRIVER INFO PAGE -->
<div dojoType="dojox.mobile.View" id="accInfo">
<h1 dojoType="dojox.mobile.Heading" back="Accident" moveTo="accHelp"
onClick="console.log('Going back');">Driver</h1>
<h2 dojoType="dojox.mobile.RoundRectCategory">Other Driver Info</h2>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
dojo.require("dojox.mobile.parser");
dojo.require("dojox.mobile");
</script>
<script type="text/javascript">
app.initialize();
function itemClicked() {
console.log("itemClicked()");
}
</script>
</body>
</html>