因此,目前我有一个简单的形式,发送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 –