1

I got error "07-12 11:39:54.578: I/Web Console(21702): JSCallback Error: Request failed. at file:///android_asset/www/js/cordova-1.8.1.js:3725"

i have 2 pages, the first page is loading normally without an error, but when I go to the next page logcat shows this error. I searched for an answer at Google, and some people said that it is a problem with android manifest, but all permissions is added.

here is code of my pages, first page:

<!DOCTYPE HTML>
<html>
<head>
<title>List Mode</title>
<link rel="stylesheet" href="css/jquery.mobile-1.1.0.min.css" />
<link rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/cordova-1.8.1.js"></script>
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.0.min.js"></script>


<script>

var i = 0;


$('#listpage').live("swiperight", function () {

    window.location.href = 'file:///android_asset/www/order.htm';
});



$('#pause').live('click', function(event){
    i++;    

    if ($('#pause .ui-btn-text').text() == "Start")
    {
    $('#pause .ui-btn-text').text("Pause");
    }

    else
    {
        $('#pause .ui-btn-text').text("Start");
    }


});


</script>
</head>
<body >
<div data-role="page" data-theme="c" id="listpage">
    <input type ="radio" name="test" class="cityArea"  id="kesklinn" /><label for="kesklinn">Kesklinn: </label>
    <input type ="radio" name="test" class="cityArea" id="lasnamae" /><label for="lasnamae">Lasnam&auml;e: </label>
    <input type ="radio" name="test" class="cityArea" id="mustamae" /><label for="mustamae">Mustam&auml;e: </label>
    <input type ="radio" name="test" class="cityArea" id="pohja-tallinn" /><label for="pohja-tallinn">P&otilde;hja-Tallinn: </label>
    <input type ="radio" name="test" class="cityArea" id="haabersti" /><label for="haabersti">Haabersti: </label>
    <input type ="radio" name="test" class="cityArea"  id="nomme" /><label for="nomme">N&otilde;mme: </label>
    <input type ="radio" name="test" class="cityArea"  id="pirita" /><label for="pirita">Pirita: </label>
    <div data-role="button" class="text" id="pause"> Start </div>
</div>
</body>
</html>

and the second:

<!DOCTYPE HTML>
<html>
<head>
<title>New order</title>
<link rel="stylesheet" href="css/jquery.mobile-1.1.0.min.css" />
<link rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/cordova-1.8.1.js"></script>
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript" src="js/orderpage.js"></script>
</head>
<body>
<div data-role="page" data-theme="c" id="orderpage">
<div id="address" class="text"> HERE COMES ADDRESS AND COMMENTS</div>

<div id="line"></div>
<table id="button_table">
    <tr>
        <td>
            <div data-role="button" class="accept_button" data-a="1 Minute" id="1min">1</div>
        </td>
        <td>
            <div data-role="button" class="accept_button" data-a="5 Minutes" id="5min">5</div>
        </td>
        <td>
            <div data-role="button" class="accept_button" data-a="7 Minutes" id="7min">7</div>
        </td>
        <td>
            <div data-role="button" class="accept_button" data-a="10 Minutes" id="10min">10</div>
        </td>
</tr>
</table>
<div id="line"></div>

<div data-role="button" data-a="decline" class="decline_button" id="decline"> No,Thanks </div>

</div>
</body>
</html>
4

2 回答 2

1

window.location.href = 'file:///android_asset/www/order.htm';在您的第一页的这一行中,file:///android_asset/www/order.htm write order.html仅替换并查看 o/p

于 2012-07-12T08:56:13.827 回答
0

不需要完整路径,只需要写

window.location.href = 'order.htm'
于 2013-11-04T14:48:22.310 回答