Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.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
在ajax加载的页面中使用ajax_Ajax_Jquery Ui_Jquery - Fatal编程技术网

在ajax加载的页面中使用ajax

在ajax加载的页面中使用ajax,ajax,jquery-ui,jquery,Ajax,Jquery Ui,Jquery,我有一个通过jquery选项卡ajax加载的页面,我在这个页面中有一个表单,我想通过ajax显示表单响应。正在从此代码加载响应: $('#whois').submit(function() { $.ajax({ data: $('#whois').serialize(), cache:false, type: "POST", url: $('#whois').attr('/lib/domainchecker.php')

我有一个通过jquery选项卡ajax加载的页面,我在这个页面中有一个表单,我想通过ajax显示表单响应。正在从此代码加载响应:

$('#whois').submit(function() { 
    $.ajax({
        data: $('#whois').serialize(), 
        cache:false,
        type: "POST", 
        url: $('#whois').attr('/lib/domainchecker.php'), 
        success: function(response) { 
            $('#reply').html(response); 
        }
    });
    return false;
);
但是我的表单提交到父页面而不是/lib/domainchecker.php。所以我看到的是我页面的标题而不是回复


知道是什么导致了这种情况吗?

当您通过AJAX在页面上加载内容时,您需要将事件应用到加载的内容,以便使用


这当然会出现在主主机页上,而不是加载的内容页上。

问题已经解决,与通过ajax加载页面无关,但代码有错误,我不应该发布到$('#whois').attr('/lib/domainchecker.php'),而应该只发布'/lib/domainchecker.php'

更正代码:

  $('#whois').live('submit', function() { 
$.ajax({
    data: $('#whois').serialize(), 
    cache:false,
    type: "POST", 
    url: '/lib/domainchecker.php', 
    success: function(response) { 
        $('#reply').html(response); 
    }
});

结果没有变化,这张纸条没有任何变化
  $('#whois').live('submit', function() { 
$.ajax({
    data: $('#whois').serialize(), 
    cache:false,
    type: "POST", 
    url: '/lib/domainchecker.php', 
    success: function(response) { 
        $('#reply').html(response); 
    }
});