开发者

jquery ajax call fails

开发者 https://www.devze.com 2023-03-03 20:35 出处:网络
$(\'.deleteBtn\').click(function(){ $(\'#videofrm\').load(\'edit.php?url=\'+encodeURI($(this).siblings(\'a\').attr(\'href\'))+\'&ac开发者_高级运维tion=delete\');
$('.deleteBtn').click(function(){
        $('#videofrm').load('edit.php?url='+encodeURI($(this).siblings('a').attr('href'))+'&ac开发者_高级运维tion=delete');
    })

edit php code is:

if($_GET['action']=='delete'){
   echo "<p>daniel</p>";
}

why is this not working???


First of all try to find out if the URL is right by placing this code right after the first line:

alert('edit.php?url='+encodeURI($(this).sublings('a').attr('href'))+'&action=delete');

If that's correct, find out if the load function is being executed properly:

$('#videofrm').load(url, function() {
  alert('url loaded');
});

I guess one of these will fail.. otherwise it should be working ;-)

======================

What happens if you use:

$('#videofrm').load('test.html');

and test.html only contains <p>test</p>

0

精彩评论

暂无评论...
验证码 换一张
取 消