我在点击按钮时调用ajax函数。
$.ajax({
type: 'GET',
url: "javascript.php?orderid=CF450AA4",
//data: "orderid=CF450AA4",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg, status) {
alert("successful");
console.log(msg);
},
error: function (msg, status) {
console.log("failure");
console.log(msg);
alert("failure");
}
});
}
我有javascipt.php文件,其中代码是为服务器端编写的,并且工作正常。 我想重新编码。我希望当有人点击按钮时,url会更改为index.php?orderid = CF450AA4,结果将在变量中传递。怎么做
答案 0 :(得分:0)
我这样做了..
location.hash = 'url';
希望对你有用..