jquery $ .post不适用于setTimeout()

时间:2012-10-21 01:56:52

标签: jquery

请看一下这段代码:

$('a.load').click(function(){
        setTimeout(function(){
            $(".content_container").append('<div class="preloading"><img src="http://localhost:8888/smart/assets/images/loading.gif" alt="loading" /></div>').show();   
            var url = 'http://localhost:8888/smart/payments.html';
            $.post(url,function(data){
                $('.content_container').append(data).show();
                $('.preloading').remove();
            });             
        },1000);    
});

问题是它没有返回所需的url,只是加载图片,它只是html页面

1 个答案:

答案 0 :(得分:1)

我看到你引用localhost:8888,你在同一个域上运行上面的代码吗?如果你不是,那么我怀疑你是Same origin policy

的牺牲品
相关问题