Ⅰ javaScript如何知道上一个页面的地址
例:history.go(-1)回到前一个页面
history.back()回到前一个页面
前一个页面的url=history.previous;
具体描述:
属性说明
Current
当前历史项的URL;
Length
反应在历史列表中的项数;
Next
下一个历史项的URL;
previous
前一个历史项的URL。
方 法 说 明
back
载历史列表中的前一个URL。
forword
装载历史列表中的下一个URL。
go
该方法的参数可以是整数,也可以是字符串。当参数是整数i时,该方法将装载历史列表中与当前URL位置相距i的URL,i既可为正数,也可为负数。当参数是字符串时,该方法将装载历史列表中含该字符串的最近的URL。
Ⅱ 怎样用js取到当前页面的上一个页面URL地址
JS:
1、document.referrer 获取上一页的URL
2、document.URL 获取当前页的URL(注:URL必须大写)
C#:
Request.UrlReferrer.AbsoluteUri
Ⅲ js怎么获取上一个页面的url
获取的方法如下:
1、设置或获取整个 URL 为字符串: window.location.href
2、设置或获取与 URL 关联的端口号码: window.location.port
3、设置或获取 URL 的协议部分 window.location.protocol
4、设置或获取 href 属性中跟在问号后面的部分 window.location.search
5、获取变量的值(截取等号后面的部分)
6、设置或获取 URL 的协议部分: window.location.protocol
7、设置或获取 href 属性中在井号“#”后面的分段: window.location.hash
8、设置或获取 location 或 URL 的 hostname 和 port 号码: window.location.host
Ⅳ 用js获取上一个页面的完整的url地址
试试
alert(document.referrer);
Ⅳ js 获取页面跳转前url
<script language="JavaScript">
alert("保存成功!");
window.location.hrf="a.jsp";
</script>
Ⅵ 如何用JS得到当前页面的URL信息
设置或获取对象指定的文件名或路径。
<script>
alert(window.location.pathname)
</script>
设置或获取整个 URL 为字专符串。
<script>
alert(window.location.href);
</script>
设置或获取与 URL 关联的端口属号码。
<script>
alert(window.location.port)
</script>
设置或获取 URL 的协议部分。
<script>
alert(window.location.protocol)
</script>
设置或获取 href 属性中在井号“#”后面的分段。
<script>
alert(window.location.hash)
</script>
设置或获取 location 或 URL 的 hostname 和 port 号码。
<script>
alert(window.location.host)
</script>
设置或获取 href 属性中跟在问号后面的部分。
<script>
alert(window.location.search)
</script>
Ⅶ 怎么获取当前页面#之前的url
window.location属性 描述 hash 设置或获取 href 属性中在井号“#”后面的分段。 host 设置或获取 location 或 URL 的 hostname 和 port 号码。回 hostname 设置或获取 location 或 URL 的主答机名称部分。 href 设置或获取整个 URL 为字符串。 pathname 设置或获取对象指定的文件名或路径。 port 设置或获取与 URL 关联的端口号码。 protocol 设置或获取 URL 的协议部分。 search 设置或获取 href 属性中跟在问号后面的部分。 如window.location.href 设置或获取整个 URL 为字符串。
Ⅷ js当前页面怎么获取另一个页面的url
不用框架,不页面传值,那就只有用cookie了
Ⅸ js如何获取前两页的url
<script>
varbackurl=document.referrer;
alert(backurl);
</script>
但是有的浏览器不支持的,如果是同个域名下通过此方式跳转的,那么我们可以通过访问windoww.opener对象去获取丢失的referrer信息。代码如下:
<scripttype="text/javascript">varreferrer=document.referrer;if(!referrer){try{if(window.opener){//IE下如果跨域则抛出权限异常//Safari和Chrome下window.opener.location没有任何属性referrer=window.opener.location.href;}}catch(e){}}</script>
你的q号,我一会远程助你。
Ⅹ JS 调用当前页面url
严谨一点最来好在form提交的时候自再对当前页地址取值:
$(function(){
varurl="{fy:dir}user/Checklogin.asp?Action=LoginCheck&olrl="+window.location.href;
$("#FormID").attr("action",url);
});
form直接写在代码里,不用js输出吧:
<formaction=""id="FormID"method="post"class="simformulogin">