私が達成したいことを詳細に説明しましょう。index.html、form.html、result.php の 3 つのページがあります。index.html のボタンをクリックしたときに jquery を使用すると、index.html の div 内に form.html がロードされます。送信時の form.html は、result.php を呼び出します。私が達成したいのは、form.html(index.htmlにロードされた)の送信ボタンをクリックすると、result.phpの結果が、form.htmlをロードしたindex.htmlのdivに表示されることです。以下は、3 ページすべてのコードです。どんな助けでも素晴らしいでしょう。
index.html の内容:
<html>
<head>
<title>index.html</title>
<script type="text/javascript" src="/scripts/jquery-1.8.2.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function () {
var theme = getTheme();
$("#loadformbutton").jqxButton({ width: '120', height: '30', theme: theme });
$("#loadformbutton").bind('click',function()
{
$('#div_for_form').load('form.html', function() {});
});
});
</script>
<div id="buttons">
<input type="button" value="loadform" id='loadformbutton' />
</div>
<div id="div_for_form">
Here loads form.html
</div>
</body>
</html>
form.html の内容:
<html>
<head>
<title>form.html</title>
</head>
<body>
<form method="POST" action="result.php">
<input type="password" name="pass" id="pass"/>
<input type="submit" value="Ok" id="changepass"/>
</form>
</body>
</html>
result.php の内容:
<?php
$received=$_POST['pass'];
echo 'Received: '.$received;
?>
現時点では機能していますが、result.php の結果が新しいページに表示されます。