เอาค่า ตัวแปร ออกมาจาก Query String.

function getQueryVariable(variable) { // var query = window.location.search.substring(1); var query =’http://okini.cts.th.venda.com/icat/jeans?curpage=200&bsref;=okini’; var onlyVar =query.split(“?”); var vars = onlyVar[1].split(“&”); for (var i=0;i
var pair = vars[i].split(“=”);
if (pair[0] == variable) {
return pair[1];
}
}
}


Posted

in

by

Tags:

Comments

Leave a Reply