动态截取字符串获取当前网页的URL地址
Posted 和路雪
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了动态截取字符串获取当前网页的URL地址相关的知识,希望对你有一定的参考价值。
动态截取字符串获取当前网页的URL地址
var url = window.location;
var urlArr = url.toString().split(‘/‘);
var ustr = urlArr[4]
if(typeof(ustr) =="undefined")
{
}
else
{
$("#w-down").attr("style","background:url(../../../images/down.png) center center;)");
$("#w-btn").attr("style","background:url(../../../images/close.png) no-repeat;) ");
$("#w-top").attr("style","background:url(../../../images/up.png) no-repeat;)");
}
var urlArr = url.toString().split(‘/‘);
var ustr = urlArr[4]
if(typeof(ustr) =="undefined")
{
}
else
{
$("#w-down").attr("style","background:url(../../../images/down.png) center center;)");
$("#w-btn").attr("style","background:url(../../../images/close.png) no-repeat;) ");
$("#w-top").attr("style","background:url(../../../images/up.png) no-repeat;)");
}
以上是关于动态截取字符串获取当前网页的URL地址的主要内容,如果未能解决你的问题,请参考以下文章