js如何获取当前文章的地址?
最佳答案:
<script>
thisURL = document.URL;
thisHREF = document.location.href;
thisSLoc = self.location.href;
thisDLoc = document.location;
strwrite = "<tr><td valign=top>thisURL: </td><td></td></tr>"
strwrite += "<tr><td valign=top>thisHREF: </td><td></td></tr>"
strwrite += "<tr><td valign=top>thisSLoc: </td><td></td></tr>"
strwrite += "<tr><td valign=top>thisDLoc: </td><td></td></tr>"
document.write( strwrite );
</script>
参考答案:
你好!<br><br>alert(location.href);<br><br>如有疑问,请追问。