'**去掉图片的属性,适合wap**************
function formatImg(img_url,master_url)
if img_url="" or isnull(img_url) then
exit function
end if
img_url = replace(img_url," src=""/"," src="""&master_url&"/")
Set regEx = New RegExp
regEx.IgnoreCase = False
regEx.Global = True
regEx.Pattern = "<img.*?\ssrc=([^\""\'\s][^\""\'\s>]*).*?>"
img_url = regEx.Replace(img_url, "<img src=""$1"" />")
'//正则匹配图片SRC地址
regEx.Pattern = "<img.*?\ssrc=([\""\'])([^\""\']+?)\1.*?>"
img_url = regEx.Replace(img_url, "<img src=""$2"" />")
formatImg = img_url
end function
实际调用 :
<%= formatImg(wt_content,"http://www.56sys.com") %>
最新评论