AjaxFilter
- 授权协议: 未知
- 开发语言:
- 操作系统: 未知
- 软件首页: http://plugins.jquery.com/project/AjaxFilter
软件介绍
This tiny plugin provides a registry for different filter functions to sanitize ajax responses.
It requires jQuery 1.3 with its new feature, the 'dataFilter' ajax setting.
If you want to provide a new implementation, you need to do something like this:
jQuery.ajaxFilter.register( 'js_in_href', 'html', function( data ){
return data.replace(/href="javascript:[^"]+"/g, '');
});or
jQuery.ajaxFilter.register('eval', 'script html json', function( data ){
return data.replace(/eval\(.+?\);?/g, '');
});Arguments for jQuery.ajaxFilter.register() are:
- Name for the filter, used as 'filter' when calling jQuery.ajax.
- One or more dataTypes to handle. Can be any combination of ajax, html, json and xml separated by spaces.
- The filter function. Will receive 2 arguments: the data and the type. The 'this' will reference the settings object.
To use it, you do:
jQuery.ajax({
url:'foo.html',
filter:'js_in_href',
// ...
});The filter can also parse the response.
That means it can (for example) provide an alternative way of eval'ing json. This is specially useful for Adobe AIR apps.
If the filter returns something else than a string, it's assumed to be the final response.
大型网站技术架构
李智慧 / 电子工业出版社 / 2013-9-1 / 59.00元
《大型网站技术架构:核心原理与案例分析》通过梳理大型网站技术发展历程,剖析大型网站技术架构模式,深入讲述大型互联网架构设计的核心原理,并通过一组典型网站技术架构设计案例,为读者呈现一幅包括技术选型、架构设计、性能优化、Web 安全、系统发布、运维监控等在内的大型网站开发全景视图。 《大型网站技术架构:核心原理与案例分析》不仅适用于指导网站工程师、架构师进行网站技术架构设计,也可用于指导产品经......一起来看看 《大型网站技术架构》 这本书的介绍吧!
