我有一个表格在桌面上张贴而没有刷新....所以我想在帖子后立即显示为聊天,但问题是表格和插入代码在同一页面chat.php,我怎么能将jquery代码放在同一页面中即可立即显示?有人可以举个例子吗?
这是表格
<form id="contact-form" class="bl_form text-center" action="<?php echo "index.php?page=rooms&room=$rid&rpw=$rpw&r=$r"; ?>" method="post" novalidate>
<span class="field-wrap scrollimation fade-right">
</span>
<span class="field-wrap scrollimation fade-left">
<textarea id="contact-message" name="message" rows="5" class="label_better requiredField" data-new-placeholder="Message"
placeholder="Message" style="margin: 0px; width: 1210px; height: 88px;" data-error-empty="<?php echo "$insert_message"; ?>"></textarea>
</span>
<p class="text-center"><button name="sy2" id="submit_post" type="submit" class="btn btn-sm btn-primary icon-left" data-error-
message="Error!" data-sending-message="Sending..." data-ok-message="Message Sent"><i class="fa fa-paper-plane"></i>Send Message</button></p>
<input type="hidden" name="submitted" id="submitted" value="true" />
<?php echo "<postfield name=\"message\" value=\"$(message)\"/>"; ?>
</form>
这是显示您发布但不包含ajax
的消息的最终代码<?php echo make_clickable($tosay)."$link_stergere"; ?>