未捕获的SyntaxError:意外的标记:在网址: 我试图呼叫控制器插入/的GetData未捕获的SyntaxError:意外的标记:
<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脚本的一部分吗? – Alireza
不,它是在视图中,我正试图加载脚本,因为页面加载 – sunil