views:

47

answers:

3

I have some set of values updated in the modal and the modal is opened on the same page . on closing the Modal How can i refresh the Page in jquery

$("#dialog-modal").bind('dialogclose',function() {
  //How Do i refresh the current Page.
)};
+5  A: 
window.location.reload(true);
Jacob Relkin
what he said ;)
Andrew Bullock
+2  A: 

Use window.location.reload():

$("#dialog-modal").bind('dialogclose',function(){
    // force the browser to get the page from the server
    window.location.reload(true);
)}

Edit:

It would appear the OP was looking for this as the answer (from comments, below):

$("#dialog-modal").bind('dialogclose',function(){
    $('#someForm').submit();
)}
Matt Ball
@Bears will eat you:when i say above line it is showing white screen in IE and it is saying with dialog "The PAgE cannot be refreshed until without resending the information ciick retry to send the information again" How can i avoid that dialog and just refreshing
Someone
You're having the user arrive at this page by a POST. See http://en.wikipedia.org/wiki/Post/Redirect/Get
Here Be Wolves
@Here: if you don't mind, use the Twitter-style "@username" so that the person you're addressing gets notified of your response. I was fairly confused by your comment...
Matt Ball
@Someone: then don't try and reload the page. Use jQuery to select the form and then submit it, like this: `$('#someForm').submit();`
Matt Ball
A: 

$(location).reload(true);

Kamikaze Mercenary
It gives the error "object doesnot support this property or method " using IE6.0
Someone
[There is no jQuery `reload()` method.](http://api.jquery.com/reload) This answer will not work.
Matt Ball