我在页面上有以下代码:
<!DOCTYPE html>
<html>
<head>
<title>Appski</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<link rel="stylesheet" href="css/style.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
<div data-role="page" id="quizPage">
<div data-role="content">
<button id="bigButton"></button>
</div><!-- /content -->
</div><!-- /page -->
</body>
<script>
$(document).ready(function() {
$("#bigButton").html("hello");
$("#bigButton").button('refresh');
});
$("#bigButton").click(function() {
window.location.replace("page2.html");
});
</script>
</html>
当我加载此页面时,它工作正常并在按钮中显示“你好”,但是当我从另一个带有以下源代码的 jQuery Mobile 页面链接时,页面加载时按钮中没有出现任何文本(并且链接没有也不行):
<a href="page1.html" data-role="button">click me</a>