因此,目前我有一個簡單的形式,發送sendchat.php消息人要鍵入..問題是我真的不想使用iframe使其工作無刷新..有人可以用正確的代碼指出我如何在BACKGROUND中執行表單提交,意味着不會進入其他頁面或刷新。GET請求使用窗體和按鈕
<form target="chat" action="sendchat.php" method="GET">
<input type="text" class="form-control" id="message" maxlength="255" name="message" type="submit" placeholder="Enter your message or use !help for help."><br>
<div class="col-xs-6 text-right">
<button type="submit button" class="btn bg-teal-400 btn-labeled btn-labeled-right"><b><i class="icon-circle-right2"></i></b> Send Message</button>
</div>
</form>
<style> .iframe { display: none; border-color: rgba(225, 225, 225, 0); border-width: 0px; } </style>
<iframe style="" name="chat" width="0px" height="0px" id="chat" onload="clearTextarea();"></iframe>
獲得自動更新而不刷新。你需要在你的網站中實現AJAX。看到這裏:http://stackoverflow.com/questions/16616250/form-submit-with-ajax-passing-form-data-to-php-without-page-refresh –