2012-07-12 52 views
1

我得到錯誤「07-12 11:39:54.578:I/Web控制檯(21702):JSCallback錯誤:請求失敗。at file:/// android_asset/www/js /cordova-1.8.1.js:3725phonegap失敗 - cordova.js錯誤3725

我有2頁,第一頁正常加載沒有錯誤,但是當我去到下一頁logcat顯示此錯誤。我在Google搜索了一個答案,有人說這是一個Android清單的問題,但所有的權限都被添加了。

這裏是我的網頁代碼,第一頁:

<!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> 

與第二:

<!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> 

回答

1

window.location.href = 'file:///android_asset/www/order.htm';在這行的唯一file:///android_asset/www/order.htm write order.html第一頁地質儲量,看到了O/P

+0

嗯...沒有工作..同樣的錯誤 – Sergio 2012-07-12 13:59:22

0

不需要完整路徑,只需編寫

window.location.href = 'order.htm'