Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JavaScript序列化无法正常工作_Javascript_Jquery_Ajax - Fatal编程技术网

JavaScript序列化无法正常工作

JavaScript序列化无法正常工作,javascript,jquery,ajax,Javascript,Jquery,Ajax,我目前正在尝试将ajax与jQuery结合使用,但有一行代码不想工作。我将在下面显示收到的错误: TypeError:$(…)。searialize不是一个函数 出现错误的行是: var info = $(this).searialize(); 这是代码: $(document).ready(function() { $("#SearchField").submit(function(e) { e.preventDefault(); // grabs all

我目前正在尝试将ajax与jQuery结合使用,但有一行代码不想工作。我将在下面显示收到的错误:

TypeError:$(…)。searialize不是一个函数

出现错误的行是:

    var info = $(this).searialize();
这是代码:

$(document).ready(function() {

  $("#SearchField").submit(function(e) {

    e.preventDefault();

    // grabs all post variables in the form
    var info = $(this).searialize();

    $.post('dictionary.php', info, function(data) {

    $('.DictionaryContentWrapper').append(data);

    });

    // prevent server from refreshing page
    return false;

  });
});

拼写为“序列化”。试试看=DIt实际上是
.serialize()
,而不是
.searialize()
?应该是serialize(),而不是searialize(),就像你在标题页中拼写的那样,我拼写错了:P
$(document).ready(function() {

  $("#SearchField").submit(function(e) {

    e.preventDefault();

    // grabs all post variables in the form
    var info = $(this).serialize(); //not searialize

    $.post('dictionary.php', info, function(data) {

    $('.DictionaryContentWrapper').append(data);

    });

    // prevent server from refreshing page
    return false;

  });
});