如何使用ajax调用整个页面 [英] How to call Entire Page using ajax

查看:125
本文介绍了如何使用ajax调用整个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,任何人都可以告诉我如何使用ajax调用整个页面(包含表单)。我将非常感谢你的帮助。

解决方案

在你的剧本中:

 


.ajax({
type: GET
url: 〜/ XYZ / FORM
success:function(data){


#BODYID)。html(data) ;
}
});





我们在这里做的是,在document.ready函数中,我们进行ajax调用,并且在成功时我们将返回的视图分配给Html布局中指定的正文ID。

希望你从中得到一些想法。

但是试试并且避免进行ajax调用,除非非常需要。

请回复您对查询的评论(如果有的话)。

谢谢

: )


Hey can anyone please tell me how to call entire page(containing form) using ajax. I'll appreciate your help.

解决方案

In your script:


.ajax({ type:"GET", url:"~/XYZ/FORM", success: function(data){


("#BODYID").html(data); } });



What we have done here is, in the document.ready function, we make a ajax call, and on success we assign the returned view to the body's id specified in the Html Layout.
Hope you get some idea from this.
But try and avoid making ajax calls, unless it is very** required.
Please post back your comments regarding queries if any.
Thanks
:)


这篇关于如何使用ajax调用整个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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