$.fn.replaceUrl = function() {  //http://www.sharejs.com   var regexp = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;    return this.each(function() {      $(this).html(        $(this).html().replace(regexp,'$1')     );    }); }  //用法   $('p').replaceUrl();  //javascript/8881