我是JqueryMobile的新手。我想嘗試一個按鈕一個簡單的點擊事件,但它不工作(我使用在Firefox)jquerymobile點擊事件不起作用
的HTML是
<!DOCTYPE html>
<html dir='ltr'>
<head>
<title>Test Page</title>
<link rel="stylesheet" href="/css/style.css"/>
<script src='js/jquery.mobile.js'></script>
<script src='js/script.js'></script>
</head>
<body>
<div data-role="page" id='mypage'>
<button id='load_ajax'>Carica</button>
<br />
<div id='content'></div>
</div><!-- /content -->
</body>
</html>
和的script.js腳本是
即使使用調試器,也不會彈出警報。
我覺得這個解決方案的工作,因爲它會調用jQuery的1.7.2。如果你刪除了這個庫,它就不能工作了。 這是必要的嗎?我認爲jquerymobile不需要jquery。 – Grey
您可以閱讀http://jquerymobile.com/demos/1.2.0/docs/about/getting-started.html並檢查http://jquerymobile.com/download/。如果您刪除了jQuery,那麼$符號無法在jQuery Mobile JS文件中解析。 –