Ajax请求,邮寄回复 [英] Ajax Request ,response by post

查看:65
本文介绍了Ajax请求,邮寄回复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Html中有一个表单,

I have one form in Html,

<form id="myform" autocomplete="off">
<div class="row 50%">
<div class="6u 12u(mobile)">
<input id="your_message" name="your_message" type="text" placeholder="What are you looking for?">
<input type="submit">
</div>
</div>
</form>




<script>


jQuery('#myform').submit(function() {
ajax('{{=URL('new_post')}}', ['your_message'], 'target')
$(function(){$("#searchresult").show();});
$('html, body').animate({
scrollTop: $("#searchresult").offset().top }, 2000);
return false;
});


</script>







我想提交此表格,我想要在目标div中显示结果。文本框充当搜索框,在提交后,它应该从Controller(从数据库)获取数据,并且应该在页面刷新时显示目标div中的结果。此外,结果将是行或数据库,我想以超链接的形式显示它们。这样我就可以点击它并在另一页上继续前进。我如何使我的结果超链接。结果来自目标div.Thanks提前




I want to submit this form and i want to display the results in the target div. Text box acts as a search box and after submitting it is supposed to fetch datat from the Controller( from the database) and should dispaly the results in target div withour page refresh. Also, the results which will be row or databases, i want to display them in the form of hyperlink. so that I can click on it and go further on another page. How can i make my results hyperlink.Results are coming in target div.Thanks in advance

推荐答案

(function(){
(function(){


(#searchresult)。show();});
("#searchresult").show();});


('html,body')。animate({
scrollTop:
('html, body').animate({ scrollTop:

这篇关于Ajax请求,邮寄回复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆