Javascript 根据AJAX请求刷新包含PHP的DIV

Javascript 根据AJAX请求刷新包含PHP的DIV,javascript,php,jquery,ajax,Javascript,Php,Jquery,Ajax,我正在制作日历,几乎完成了。最后一件事是允许用户选择一个日期,并从按钮submit上选择的日期开始刷新日历。到目前为止,我已经在我的calendar.php文件中完成了这项工作: <input type="text" name="date" class="datepicker" id="arrivaldate" style="width:80px; margin-top:20px;" /></div> <input type="submit" id="go" val

我正在制作日历,几乎完成了。最后一件事是允许用户选择一个日期,并从按钮submit上选择的日期开始刷新日历。到目前为止,我已经在我的
calendar.php
文件中完成了这项工作:

<input type="text" name="date" class="datepicker" id="arrivaldate" style="width:80px; margin-top:20px;" /></div>
<input type="submit" id="go" value="GO" />
现在,我的控制台中出现以下错误:

Uncaught TypeError: Illegal invocation jquery-1.10.2.js:7499
add                                    jquery-1.10.2.js:7499
buildParams                            jquery-1.10.2.js:7551
buildParams                            jquery-1.10.2.js:7546
buildParams                            jquery-1.10.2.js:7546
buildParams                            jquery-1.10.2.js:7546
jQuery.param                           jquery-1.10.2.js:7519
jQuery.extend.ajax                     jquery-1.10.2.js:8021
(anonymous function)                   calendar.php:115
jQuery.event.dispatch                  jquery-1.10.2.js:5095
elemData.handle                        jquery-1.10.2.js:4766


我觉得,如果没有错误,这仍然是错误的做法。我之前曾发布过一个类似的问题,最终找到了自己的答案,这与我现在遵循的解决方案相同。我只知道一定有更好的办法。我知道它在Visual Studio中非常简单(使用UpdatePanel),我只是想为这种情况找到一个明确的解决方案。

我怀疑
calendar.load()
方法可能期望通过
html
变量(在成功中)传递
classes/create\u cal.php
的内容,而不是文件路径本身<代码>变量数据字符串={date:date}可能还希望是
var-datastring={“date”:date}以确保第一个“日期”保持为字符串日期,而不是交给日期选择器result@Carl谢谢你的意见。你知道有什么不同的方法吗?
//get date from $_GET
    $date = (isset($_GET['date']) ? $_GET['date'] : date("Y-m-d"));
    $date_arr = explode("-",$date);
    $year = $date_arr[0];
    $month = $date_arr[1];
    $day = $date_arr[2];
Uncaught TypeError: Illegal invocation jquery-1.10.2.js:7499
add                                    jquery-1.10.2.js:7499
buildParams                            jquery-1.10.2.js:7551
buildParams                            jquery-1.10.2.js:7546
buildParams                            jquery-1.10.2.js:7546
buildParams                            jquery-1.10.2.js:7546
jQuery.param                           jquery-1.10.2.js:7519
jQuery.extend.ajax                     jquery-1.10.2.js:8021
(anonymous function)                   calendar.php:115
jQuery.event.dispatch                  jquery-1.10.2.js:5095
elemData.handle                        jquery-1.10.2.js:4766