我找到了 jquery mobile 的这个插件 它工作正常,但我无法在第二页加载时执行任何代码,我尝试了任何类型的 jqmobile 事件但没有...
这是 page1.htm 的代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/jquery.mobile-1.0b2.min.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.mobile.pagination.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='Js/Libs/jquery-1.6.2.min.js'></script>
<script type='text/javascript' src='Js/Libs/jquery.mobile-1.0b2.min.js'></script>
<script type='text/javascript' src='Js/Libs/jquery.mobile.pagination.js'></script>
</head>
<body>
PAGE1
<ul data-role="pagination">
<li class="ui-pagination-prev"><a href="page0.htm">Prev</a></li>
<li class="ui-pagination-next"><a href="page2.htm">Next</a></li>
</ul>
</body>
</html>
这是 page2.htm 的代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="css/jquery.mobile-1.0b2.min.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.mobile.pagination.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='Js/Libs/jquery-1.6.2.min.js'></script>
<script type='text/javascript' src='Js/Libs/jquery.mobile-1.0b2.min.js'></script>
<script type='text/javascript' src='Js/Libs/jquery.mobile.pagination.js'></script>
</head>
<body onload="">
<script type="text/javascript">
$('div').live('pageshow', function (event, ui) {
alert('This page was just hidden: ');
});
</script>
</body>
</html>