做了一个小偷,首先从a.asp中获得远程数据,仅列出标签A
然后从另一个页面通过jquery来再次分析a.asp中的标签
xp下在a.asp中加入<base herf="xxxxx">jquery就能得到准确的绝对网址,但是在win7下却不行。请问该如何解决?xp下仅ie可以,其他浏览器不行,因此我又修改了jquery中对应的xmlhttp版本,还不行。或者谁能提供一个相对网址转绝对网址的函数。
万分感谢!
然后从另一个页面通过jquery来再次分析a.asp中的标签
xp下在a.asp中加入<base herf="xxxxx">jquery就能得到准确的绝对网址,但是在win7下却不行。请问该如何解决?xp下仅ie可以,其他浏览器不行,因此我又修改了jquery中对应的xmlhttp版本,还不行。或者谁能提供一个相对网址转绝对网址的函数。
万分感谢!
主要是最近太懒了,什么都不想写。等半天没人回帖,自己写了个函数搞定了。
Function GetUrl(u,h)
u = LCase(u)
If left(u,7) <> "http://" Then
Exit Function
End if If instr(u,"?") Then
u = Mid(u,1,instr(u,"?"))
End If u = Replace(u,"http://","") Dim url
url = Split(u,"/") If Left(h,1) = "/" Then
GetUrl = "http://" & url(0) & h
Exit Function
End if If ubound(url) = 0 Then
GetUrl = "http://" & url(0) &"/"&h
Exit Function
End If If url(UBound(url)) = "" Then
GetUrl = "http://" & u & h
Exit Function
End If Dim i
For i = 0 To UBound(url) - 1
GetUrl = GetUrl & "/" & url(i)
Next
GetUrl = "http:/" & GetUrl & "/" & h
End Function