[英]Uncaught SyntaxError: Unexpected token :
未捕获的SyntaxError:意外的令牌:在url:我正在尝试调用控制器insert / getdata
<script>
$(window).load(function(){
// do something
$(document).ready(function () {
//d= <?php echo $userid; ?>
$.ajax({
url:"http://localhost/CodeIgniter/index.php/insert/getdata", //The url where the server req would we
async: false,
type: "POST", //The type which you want to use: GET/POST
data: {activeNodeID : <?php echo $userid; ?>}, //The variables which are going.
//This is the function which will be called if ajax call is successful.
success: function(response){
$("#ques").html(response);
$("#ques").show();
}
});
});
});
那条线很好。 我认为由于此行而引发错误:
<?php echo @userid; ?>
这段代码应该放在PHP服务器脚本中,但是发现了无法理解的方式。 用适当的内容(变量或常量字符串文字)替换该代码,它将起作用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.