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 respectThat 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
.
精彩评论