J-Query或Ajax(哪个最好?) [英] J-Query OR Ajax (which is best?)

查看:57
本文介绍了J-Query或Ajax(哪个最好?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有朋友,



我在两种情况之间真的很混淆,事情就是这样。我有两个来自控制器1的数据加载解决方案.J-query 2.Ajax数据加载现在问题是........哪个是最好的解决方案?



1.Jquery_Code: -



Dear All Friends,

i am really very confuse in between two scenario, the thing is going like this. i have two solution for data load from the controller 1. J-query 2.Ajax Data-load now the question is ........which is the best and good solution?

1.Jquery_Code :-

 $('#DivNotify').load('/Dashboard/Index?dval=' + ddlSize + ' #notify', function (data) {
           
}

2.Ajax Dataload    :-

 $.ajax({

                    url: '/Dashboard/Index,
                    type: "GET",
                    dataType: "json",
                    async: true,
                    contentType: "application/json; charset=utf-8",
                    success: function (result) {


}



上面是两个场景的代码让我指导哪个是最好的效果解决方案?...


Above is the code of both scenario let me guide which is the best effective solution?...

推荐答案

' # DivNotify')。load(' / Dashboard / Index?dval =' + ddlSize + ' #notify' function (数据){

}

2 .Ajax Dataload: -
('#DivNotify').load('/Dashboard/Index?dval=' + ddlSize + ' #notify', function (data) { } 2.Ajax Dataload :-


.ajax({

url:' / Dashboard / Index,
type: GET,
dataType:json,
async:true,
contentType:application / json; charset = utf-8,
成功:功能(结果){


}



上面是两个场景的代码让我指导哪个是最有效的解决方案?...


Above is the code of both scenario let me guide which is the best effective solution?...


它们只是jQuery Ajax的不同变体, http://api.jquery.com/category/ajax/ [ ^ ]

参考: http://stackoverflow.com/questions/3870086/difference-between-ajax-and-get-and-load [ ^ ]
They are just different variants of jQuery Ajax, http://api.jquery.com/category/ajax/[^]
Refer: http://stackoverflow.com/questions/3870086/difference-between-ajax-and-get-and-load[^]


这篇关于J-Query或Ajax(哪个最好?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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