我有這個PHP:你如何使用PHP和和jQuery獲取jsonp?
$response = 'success';
$response = json_encode($response);
echo $_GET['callback'] . '('.$response.')';
與這個jQuery:
$.ajax({url: "/*url*/?invite="+getinvite+"&api="+api, dataType:"jsonp",
success: function(response){/*do stuff*/}});
在XAMPP我的筆記本電腦它是偉大的工作。然後當我把它放在我的服務器上,它給了我這個錯誤:Undefined index: callback
。爲什麼不讓我設置$_GET['callback']
?以及如何解決這個問題?