admin管理员组文章数量:1026423
I have not been able to get a clear idea of the purpose of datafilter in jquery.
while searching I found the following
datafilter: A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering function to sanitize the response.
Can anyone give me a clear idea? Am new to jquery and Ajax.
I have not been able to get a clear idea of the purpose of datafilter in jquery.
while searching I found the following
datafilter: A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering function to sanitize the response.
Can anyone give me a clear idea? Am new to jquery and Ajax.
Share Improve this question edited Oct 14, 2015 at 18:59 MER 1,57120 silver badges27 bronze badges asked Apr 13, 2013 at 7:18 user2156088user2156088 2,4306 gold badges22 silver badges24 bronze badges 01 Answer
Reset to default 4An example of WHAT it could be for could be a custom data pression implementation. Say you're returning xml or json and you want to press is. You could potentially add a dataFilter that depresses the raw data and returns it.
Note that the dataFilter runs PRIOR to the parser. So as long as you return valid json, xml, etc the parser will e along and pass on the response in the correct type.
ex:
$.ajaxSetup({dataFilter:depressRaw}); //global depression for all calls from the page
function depressRaw(data, dataType){
return someDepressionFunction(data);
}
I have not been able to get a clear idea of the purpose of datafilter in jquery.
while searching I found the following
datafilter: A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering function to sanitize the response.
Can anyone give me a clear idea? Am new to jquery and Ajax.
I have not been able to get a clear idea of the purpose of datafilter in jquery.
while searching I found the following
datafilter: A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering function to sanitize the response.
Can anyone give me a clear idea? Am new to jquery and Ajax.
Share Improve this question edited Oct 14, 2015 at 18:59 MER 1,57120 silver badges27 bronze badges asked Apr 13, 2013 at 7:18 user2156088user2156088 2,4306 gold badges22 silver badges24 bronze badges 01 Answer
Reset to default 4An example of WHAT it could be for could be a custom data pression implementation. Say you're returning xml or json and you want to press is. You could potentially add a dataFilter that depresses the raw data and returns it.
Note that the dataFilter runs PRIOR to the parser. So as long as you return valid json, xml, etc the parser will e along and pass on the response in the correct type.
ex:
$.ajaxSetup({dataFilter:depressRaw}); //global depression for all calls from the page
function depressRaw(data, dataType){
return someDepressionFunction(data);
}
本文标签: javascriptfunctionality of datafilter in Ajax jQueryStack Overflow
版权声明:本文标题:javascript - functionality of datafilter in Ajax jQuery - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745639403a2160650.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论