[jQuery] Ajax reacts very slow...?
Hi,
I have this function build:
$.ajax({
type: "POST",
url: "/ajax_add_selected_product_to_session.php?global_check",
success: function(msg){
/* add here what to do on success */
//alert(msg);
howmanyfromsession = msg;
if (howmanyfromsession == 1){
$(".amount").empty();
$(".amount").append(' (Derzeit ist ' + howmanyfromsession + '
Produkt vorgemerkt)');
}else if(howmanyfromsession > 1){
$(".amount").empty();
$(".amount").append(' (Derzeit sind ' + howmanyfromsession + '
Produkte vorgemerkt)');
}else if(howmanyfromsession == 0){
$(".amount").empty();
}
if(howmanyonpage == 0 && howmanyfromsession == 0) {
//alert('None are checked on page');
$(".requestbutton").attr("disabled", "disabled");
}else if(howmanyonpage == 0 && howmanyfromsession > 0){
//alert('At least one is checked');
$(".requestbutton").removeAttr("disabled");
$(".requestbutton").click(function(){
$("#list").submit();
});
}
$(".requestbutton").click(function(){
if($("input[name^='paradigm']:checked").length > 0) {
$("#list").submit();
}
});
}
The part with:
$(".amount").append(' (Derzeit ist ' + howmanyfromsession + ' Produkt
vorgemerkt)');
takes really long at the moment. Is there a way to improve the speed?
If you want you can test it here:
http://packpilot.s15312582.onlinehome-server.info/search.php?action=list&prg_fkid_prg_id=81&prg_id=86
Look for the button "Für ausgewählte Artikel Herstelleranfrage senden"
on its right hand side a small text will appear, telling how many
products you have selected.
I don't understand why it takles so long...?
Any ideas?