我正在使用cordova进行android平台上的移动应用程序开发。我在www/index.html文件中有以下html代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<script src="cordova-2.2.0.js" type="text/javascript"></script>
<script src="jquery/jquery.js" type="text/javascript"></script>
<script src="jquery.mobile/jquery.mobile-1.1.0.js" type="text/javascript"></script>
<script src="JS/main.js" type="text/javascript"></script>
<link rel="stylesheet" href="CSS/main.css"/>
</head>
<body id="body" class="body">
<div id="box" class="bodyBlack">
</div>
</body>
</html>
我不知道为什么,但当我运行这个应用程序时(也是在pc浏览器上打开时),我在页面底部添加了这个div:
<div ui-loader ui-corner-all ui-body-a ui-loader-default>
<span ui-loader ui-corner-all ui-body-a ui-loader-default></span>
<h1>loading</h1>
以下是main.js的内容:
$(document).ready(function(){
$('#box').click(function(){
if($(this).attr('class') == 'bodyBlack'){
$(this).removeClass('bodyBlack');
$(this).addClass('bodyWhite');
}
else{
$(this).removeClass('bodyWhite');
$(this).addClass('bodyBlack');
}
});
});
为什么?它是从哪里来的?我该如何阻止它这样做呢?谢谢!
发布于 2012-11-13 05:14:40
这似乎是jQuery手机生成的“加载消息”,请参阅this answer。所以jQuery手机正在加载一些东西(可能找不到它)。如果您仍然有问题,请发布您的main.js
文件的内容!
https://stackoverflow.com/questions/13347970
复制相似问题