1
我有我的jQuery手機頁面如下。它具有帶有文本字段和div的窗體,我需要在由java腳本提交表單後在同一頁面上顯示對話框(帶ID爲「dialog1」的div)。jquery mobile:從java腳本打開對話框中的頁面div
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/themes/site_theme/css/mobile.css" />
<link rel="stylesheet" href="/themes/site_theme/css/jquery.mobile-1.2.0.css" />
<script src="/themes/site_theme/js/jquery-1.7.1.min.js"></script>
<script src="/themes/site_theme/js/jquery.mobile-1.2.0.js"></script>
<script src="/themes/site_theme/js/min.js"></script>
</head>
<body><div data-role="page" id="registerPage">
<div data-role="header">
<a href="/app/index" data-icon="home" data-theme="b">Home</a>
<h1>Brand List</h1>
<a href="#" data-role="button" data-rel="back" data-icon="arrow-l"data-theme="b">Back</a>
</div>
<div data-role="content">
<form data-ajax="false" id="textForm" >
<textarea name="comments" id="comments" placeholder='Type your comments' size="85"></textarea>
<div align="center">
<input data-mini="true" data-inline="true" type="button" value="Submit" onClick="javascript: formText();" />
<input type="hidden" name="company_id" value="3" >
<input type="hidden" name="branch_id" value="3" >
<input type="hidden" name="campaign_id" value="6" >
</div>
</form>
</div>
<div data-role="dialog" id="dialog1" class="app-dialog">
<div data-role="header">
<h3>A dialog</h3>
</div>
<div id="content" data-role="content">
<p>I am a dialog....!</p>
</div>
</div>
</div>
</body>
</html>
你有什麼問題嗎? 'formtext()'是怎麼樣的? – Taifun