我有一个文件,里面有一个很长的脚本,里面有一个变量“句点”。我将通过网站的首页将该变量的值发送到该文件。该值将被填充到文件中,并返回到首页。所以我想要像<code period="1">一样把代码<code period="x">放在首页
我想用不同的值多次这样做。有人知道如何做到这一点吗?
我看过这个脚本,但它不起作用:
if($error === false) {
alert($error);
$.ajax({
url: '\get.php',
type: 'POST',
dataType: "json",
data: {
period: "1"
},
success: function(data){
alert(JSON.stringify(data));
}
});谢谢
发布于 2014-03-30 22:15:09
你有一个语法错误。请参阅内联注释:
if($error === false) {
alert($error);
$.ajax({
url: '/get.php',
type: 'POST',
dataType: "json",
data: {
period: "1"
},
success: function(data){
alert(JSON.stringify(data));
}
});
} // << this was missing发布于 2014-03-30 22:17:21
对于成功的回调,您错过了一个}。
发布于 2014-03-30 22:44:02
if($error === false) {
alert($error);
$.ajax({
url: '/get.php',
type: 'POST',
dataType: "json",
data: {
period: "1"
},
success: function(data){
alert(JSON.stringify(data));
}
});
}// **This was missing**https://stackoverflow.com/questions/22745013
复制相似问题