asp如何调用JS函数并获取值
<scriptlanguage=vbs>Functionnohtml(str)dimreSetre=newRegExpre.IgnoreCase=truere.Globa...
<script language=vbs>
Function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="<(.[^>]*)>"
str=re.replace(str,"")
nohtml=str
set re=nothing
End Function
</script>
我post一个TXT过来,需要把TXT里面的HTML去掉,如何调用?
mytext=nohtml(trim(request.form("txt")))??这样肯定不对吧,JS根本没看过,大家帮帮忙。 展开
Function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="<(.[^>]*)>"
str=re.replace(str,"")
nohtml=str
set re=nothing
End Function
</script>
我post一个TXT过来,需要把TXT里面的HTML去掉,如何调用?
mytext=nohtml(trim(request.form("txt")))??这样肯定不对吧,JS根本没看过,大家帮帮忙。 展开
2个回答
2010-12-27
展开全部
你用服务端的nothml函数就行了:
'去掉所有的HMTL
Function NoHtml(strWord)
Dim Str,re
Str=strWord
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="<(.[^>]*)>"
Str=re.Replace(Str, "")
Str=Replace(Str," ","")
Str=Replace(Str," ","")
str=Replace(Str," ","")
Set Re=Nothing
NoHtml=Str
End Function
'去掉所有的HMTL
Function NoHtml(strWord)
Dim Str,re
Str=strWord
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="<(.[^>]*)>"
Str=re.Replace(Str, "")
Str=Replace(Str," ","")
Str=Replace(Str," ","")
str=Replace(Str," ","")
Set Re=Nothing
NoHtml=Str
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询