Function ImgOutReplace(ImgStr,ImgW,ImgH)
Dim Imgi,Imgj,Imgk,Imgm,Imgn,ImgReStr,Imgtext,ImgNum
If IsNull(ImgStr) Or ImgStr="" Then
Exit Function
Else
ImgReStr = ""
ImgStr = Replace(ImgStr,vbCrLf,"")
Imgtext = ImgStr
Imgk = Len(ImgStr)
For Imgi = 0 To Imgk
If Instr(ImgStr,"<") > 0 Then
Imgn = ""
Imgm = ""
Imgj = ""
Imgn = Instr(ImgStr,"<")
Imgm = Instr(ImgStr,">")
ImgNum = Imgm-Imgn+1
Imgj = Imgn+1
If Lcase(Mid(ImgStr,Imgj,3)) = "img" Then
On Error Resume Next
ImgReStr = Mid(ImgStr,Imgn,ImgNum)
Exit For
ElseIf Mid(ImgStr,Imgj,1) <> " " Then
On Error Resume Next
ImgReStr = Mid(ImgStr,Imgn,ImgNum)
ImgStr = Replace(ImgStr,ImgReStr,"")
ImgReStr = ""
End If
ElseIf Instr(Lcase(ImgStr),"<") > 0 Then
Imgn = ""
Imgm = ""
Imgj = ""
Imgn = Instr(Lcase(ImgStr),"<")
Imgm = Instr(Lcase(ImgStr),">")
ImgNum = Imgm-Imgn+4
Imgj = Imgn+4
If Lcase(Mid(ImgStr,Imgj,3)) = "img" Then
On Error Resume Next
ImgReStr = Mid(ImgStr,Imgn,ImgNum)
Exit For
ElseIf Mid(ImgStr,Imgj,1) <> " " Then
On Error Resume Next
ImgReStr = Mid(ImgStr,Imgn,ImgNum)
ImgStr = Replace(ImgStr,ImgReStr,"")
ImgReStr = ""
End If
End If
Next
If IsNull(ImgReStr) Or ImgReStr="" Then
ImgStr = ""
Else
ImgStr = ImgReStr
End If
End If
ImgStr = Replace(Lcase(ImgStr),"src"," onload='javascript:DrawImage(this,"&ImgW&","&ImgH&");' onmouseover='javascript:DrawImage(this,"&ImgW&","&ImgH&");' src")
ImgOutReplace = CheckStr(ImgStr,3)
ImgStr = ""
End Function%>
<%call ImgOutReplace(titdle,100,100)%>'子函数说明:内容,图片宽,图片高
这段代码有错吗?
为什么显示不出来图片