DCHP
DCHP

Reputation: 1131

Ajax browser refresh in background

i am trying to produce a browser refresh in the background after a click.

My issue is i am allread using ajax to process other element on the page but i need these to be updated.

// approved - allready approved section

$('.allready_approved').click(function(event) {
        event.preventDefault();                 
    $('#main_bloc_approved').slideUp();

    // i need to perform a browser refresh here but without reloading the page here???

     $('#main_bloc_allready_approved').fadeIn();                    
     return false;


     return false;
});

$('.approved').click(function(event) {
            event.preventDefault();             
    $('#main_bloc_allready_approved').slideUp();

     // i need to perform a browser refresh here but without reloading the page here???

     $('#main_bloc_approved').fadeIn();
     return false;
});

Upvotes: 0

Views: 4384

Answers (1)

Val
Val

Reputation: 17522

I think you should use, unless I have misunderstood you :)

$(document).ready(function (){
   $('body').load(window.location.href,'body');
});

also convert your .click (...) into .live('click',...)

also you have return false; twice which is only needed once really.

Not that I wanna be technical about this but,

(number of clicks + number of unnecessary bytes) * number of users = better think of another way e.g. .setTimeout() to update every minute to save some bandwidth or you will go bankrupt before you care to think :) but thats my opinion and not a fact :)

Upvotes: 4

Related Questions