未捕獲的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