/**
* 从URL里解析出传过来的值
*
* @param paramName
* @return
*/
function getParam(paramName) {
paramValue = "";
isFound = false;
if (this.location.search.indexOf("?") == 0
&& this.location.search.indexOf("=") > 1) {
arrSource = unescape(this.location.search).substring(1,
this.location.search.length).split("&");
i = 0;
while (i < arrSource.length && !isFound) {
if (arrSource[i].indexOf("=") > 0) {
if (arrSource[i].split("=")[0].toLowerCase() == paramName
.toLowerCase()) {
paramValue = arrSource[i].split("=")[1];
isFound = true;
}
}
i++;
}
}
return paramValue;
}
//===========获取get方法传值===========
var G_ID=getParam("G_ID");
// 拼装LOGO地址
var location = (window.location + '').split('/');
var basePath = location[0] + '//' + location[2] + '/'+ location[3];
//使用
$.ajax({
url : basePath + "/user/goodsInit.do", //发出请求的服务端url地址
type : "post", //post/get
data : "", //服务端服务端传递参数
dataType : "json", //服务端服务器返回的类型
success : show //执行成功后如何处理
})