【发布时间】:2013-08-14 13:18:24
【问题描述】:
我正在使用带有 ajax 的 jquery。我可以成功传递数据,但我收到“SyntaxError: JSON.parse: unexpected character”的错误
这是我的代码:
$.ajax({
method:'post',
dataType:'json',
url: "storeEventData.php",
data: $('#recuringForm').serialize(),
onSuccess: function(response){
alert("hello");
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(errorThrown);
}
});
这里是 storeEventData.php 代码:
<?php
ob_start();
// Start the session
session_start();
$_SESSION = $_POST;
echo '<pre>'; print_r($_SESSION); exit;
?>
让我知道我哪里出错了?
谢谢
【问题讨论】:
-
从 storeEventData.php 粘贴代码
-
@hex4,我添加了 storeEventData.php