我使用Cordova和JQuery mobile为Android创建了一个应用程序.当我使用谷歌浏览器测试运行代码时,它运行良好,但当我尝试在Android模拟器上使用android studio在cmd(locate>cordova emulate android)中运行它时它不起作用.
当我尝试在模拟器上运行它时,我得到:
"与服务器的连接不成功.(file:///android_asset/www/index.html)"
但如果我不使用JQuery,它工作正常.我没有修改JQuery或JQuery mobile中的任何代码.
<head>
<-- import jquery and codovar -->
<link rel="stylesheet" href="./css/jquery.mobile-1.4.5.min.css" />
<-- if i remove this 3 line of code below program is working as same as open with google chrome -->
<link rel="stylesheet" href="./css/jquery.mobile-1.4.5.min.css" />
<script src="./js/jquery-2.1.4.min.js"></script>
<script src="./js/jquery.mobile-1.4.5.min.js"></script>
<--end remove here -->
<script type="text/javascript" src="./js/Login.js"></script>
</head>
<body>
<div data-role="page" id="page1">
<div data-role ="header" style="background-color: #00CCA5;">
<h1 style="color: #FAF0BA; text-shadow: None; text-align: center;">LogIn</h1>
</div>
<div data-role …Run Code Online (Sandbox Code Playgroud)