开发者

Problem with loading content without refresh by .load()

why after several times click on buttons, is hang website? i use of function .load() for loading content(html). i use of firebug for solution this problem but did not succeed.

my purpose is this buttons:

http://i.stack.imgur.com/ElWXy.gif

you yourself can see my site : http://zigweb.ir/siran/

and can see this js code to address: http://zigweb.ir/siran/files/js/admin.js

$('#icon a').click(function (event) {
        event.preventDefault();
        var id = '#' + this.id;
        var title = $(id).attr('title');
        $(".title").toggleClass("suject").html(title);
        var url = $(id).attr('href');
        $('.table_show, #num_count, #select_box, #input_search').fadeOut('slow', function () {
            $('.results').load(url+' .load', function(){
                $(this).hide().show();开发者_运维技巧
                $.getScript("http://zigweb.ir/siran/files/js/admin.js"); 
            })
            //.hide().show("slow")
        });
    });

please tell me, what do i do?

With respect


That is because of a Same-origin policy.

Chrome Inspector says,

XMLHttpRequest cannot load http://localhost/test/1st.htm. Origin http://zigweb.ir is not allowed by Access-Control-Allow-Origin.

To fix this, you should change the request URL from http://localhost to http://zigweb.ir.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜