下面我们举例一个URL,然后获得它的各个组成部分: http://i.cnblogs.com/EditPosts.aspx?opt=1 window.location.href (设置或获取整个 URL 为字符串) var test = window.location.href; alert(test); // 返回:http://i.cnblogs.com/EditPosts.aspx?opt=1 window.location.protocol (设置或获取 URL 的协议部分) var t
<?php echo $this->getStoreUrl('checkout/cart');?> 获取结账页面的url:<?php echo $this->getUrl('checkout/cart');?> magento的常用函数: //Get the path of your magento page. echo $this->getUrl('mypage'); //Get the path of the image in your skin folder
//获取url后边的参数 $.getUrlParam = function (name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) re
function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = decodeURI(window.location.search.substr(1)).match(reg); if (r != null)return unescape(r[2]); return null; } var sname = GetQuer
JavaScript function GetParams(urlAddress) { var i, strLength, str, keyName, keyValue, params = {}, url = document.getElementById('sf_debug').src; if (url.indexOf("?") > -1) { var index = url.indexOf("?"); str = url.substring(index +
1.window.location.href(设置或获取整个 URL 为字符串) var test = window.location.href;alert(test);返回:http://i.cnblogs.com/EditPosts.aspx?opt=1 2.window.location.protocol(设置或获取 URL 的协议部分) var test = window.location.protocol;alert(test);返回:http: 3.window.location.h
js如何准确获取当前页面url网址信息 在WEB开发中,时常会用到javascript来获取当前页面的url网址信息,在这里是我的一些获取url信息的小总结. 下面我们举例一个URL,然后获得它的各个组成部分:http://i.cnblogs.com/EditPosts.aspx?opt=1 1.window.location.href(设置或获取整个 URL 为字符串) var test = window.location.href;alert(test);返回:http://i.cnblog