【发布时间】:2013-09-18 23:07:11
【问题描述】:
当使用 Jquery 的 get 函数时,我发现了一个我已经实现的代码 sn-p,其中数据被发送到服务器。数据作为字典提供给 get 函数。在这本字典中,键充当字符串,但不包含在引号中。此字典中的值被包装为字符串。谁能解释一下有什么区别?变量名称和时间未在脚本中先前的任何位置定义。 包括下面的整个脚本。
<script>
$(document).ready(function () {
$.ajaxSetup({ cache: false });
$('button').click(function () {
$.get('query.php',{ name: "John", time: "2pm" },function (data) {
alert(data);
});
});
});
</script>
【问题讨论】: