Asp收藏当前页面的网址到收藏夹

<%
function getip   '获取ip
   if Request.ServerVariables("HTTP_X_FORWARDED_FOR")=empty then
      getip=Request.ServerVariables("REMOTE_ADDR")
   else
      getip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
   end if
end function

response.Write getip
%>
<script>
var hostname = location.hostname;      //获取当前域名
var localurl = location.href;          //获取当前的url地址信息 
</script>
<A href="#" onClick="this.style.behavior='url(#default#homepage)';window.external.addFavorite(localurl,'www.A-sj.cn')">加入收藏</A>

你可能感兴趣的:(asp)