Я китаец! У меня плохой английский, но у меня проблемы с JQuery Mobile! Надеюсь, что
иностранный друг может помочь мне. Вопрос ниже!
first: На first.jsp нажмите кнопку «General» в порядке. Но кнопка «Submit» не в порядке. Почему ??
секунда: нажмите кнопку «Ссылка», перейдите к second.jsp, нажмите кнопку «Тест». Код JavaScript не выполняется!
Я не знаю, почему они случаются! Вы можете мне помочь! Спасибо.
first.jsp
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
<title>China</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="/mobile/mobile/common/script/jQuery/jquery.mobile-1.0a2.css" />
<script type="text/javascript" src="/mobile/mobile/common/script/jQuery/jquery-1.4.4.js"></script>
<script type="text/javascript" src="/mobile/mobile/common/script/jQuery/jquery.mobile-1.0a2.js"></script>
<script>
$(function(){
$('#Button').click(function(){
alert('This is a general button!');
});
$('#ButtonSubmit').click(function(){
alert('This is a submit button!');
});
});
</script>
</head>
<body>
<div id="page" data-role="page" data-theme='d'>
<div data-role="header" data-position="inline" data-position="fixed">
<h1>Chinese</h1>
</div>
<div data-role="content">
<a id="Button" data-role='button' data-iconpos="right" data-icon="gear">General Button</a>
<a id="ButtonSubmit" data-role='button' data-iconpos="right" type="submit" data-icon="gear">Submit Button</a>
<a id="link" href="/mobile/mobile/second.jsp" data-role='button' data-iconpos="right" data-icon="gear">Link Button</a>
</div>
<div data-role="footer" data-position="fixed">
<h1>[Email:zhaosheng.wolf@163.com][1]</h1>
</div>
</div>
</body>
</html>
second.jsp
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
<title>China</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="/mobile/mobile/common/script/jQuery/jquery.mobile-1.0a2.css" />
<script type="text/javascript" src="/mobile/mobile/common/script/jQuery/jquery-1.4.4.js"></script>
<script type="text/javascript" src="/mobile/mobile/common/script/jQuery/jquery.mobile-1.0a2.js"></script>
<script>
$(function(){
$('#test').click(function(){
alert('This is a general button!');
});
});
</script>
</head>
<body>
<div id="page" data-role="page" data-theme='d'>
<div data-role="header" data-position="inline" data-position="fixed">
<h1>[Chinese][2]</h1>
</div>
<div data-role="content">
<a id="test" data-role='button' data-iconpos="right" data-icon="gear">Test</a>
</div>
<div data-role="footer" data-position="fixed">
<h1>Email:zhaosheng.wolf@163.com</h1>
</div>
</div>
</body>
</html>
[1]: http://zhaosheng.wolf@163.com
[2]: http://zhaosheng.wolf@163.com