AjaxFilter

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-11 09:12:44

软件介绍

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:

  1. Name for the filter, used as 'filter' when calling jQuery.ajax.
  2. One or more dataTypes to handle. Can be any combination of ajax, html, json and xml separated by spaces.
  3. 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.

本文地址:https://codercto.com/soft/d/23129.html

搜索模式

搜索模式

Peter Morville、Jeffery Callender / 蒋彬 / 电子工业出版社 / 2010-10 / 35.00元

本书是信息架构领域创始人彼得•莫维里的又一力作,全书详尽剖析了10种搜索模式,告诉读者如何为不同情境设计搜索功能,涉及互联网、电子商务、企业、手机、社交和实时搜索等不同平台和领域。每种搜索模式均配以大量案例,并结合了作者自身的经验,因此更富实用性和实战性。书中遍布作者对于搜索模式的探索和思考,既适合对未来的搜索进行前瞻性的探讨,也能够指导当前进行中的项目。一起来看看 《搜索模式》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具