[removed].reload not working for Firefox and Chrome

前端 未结 8 548
灰色年华
灰色年华 2020-12-08 15:44

I want to change the user status on click of a Button, so all I am doing is, detecting the current status and changing, if needed.

But in this case the changes the s

8条回答
  •  情书的邮戳
    2020-12-08 16:12

    I had the same issue in Chrome and Firefox. I was able to alleviate the issue by having the server respond with the url of the page. For your case you could have the response be the new value for the user status. Here are two examples:

    $.post('?action=' + myAction, function (data) {
            window.location.href = data;
        });
    

    ..and the server response

    Response.Write("/yourUrl);
    Response.End();
    

    This eliminated the inconsistency in Chrome and the page reloads without fail.

提交回复
热议问题