Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
130
rated 0 times [  137] [ 7]  / answers: 1 / hits: 16430  / 13 Years ago, thu, august 11, 2011, 12:00:00

I would like not to dispaly the pop-up message below when post back occurs. My page has nothing to do with pricing it is displaying ms chart that updates on postback. How to disable in code or java script?




to display the webpage again internet explorer needs to resend the information you've previously submitted.




This is the javascript i've tried: doesn't work though.



<script type=text/javascript>
// <!--
function submitForm() {
window.opener.document.forms[0].submit();
}
// -->
</script>


and is attached the function to the form as so:



<body>
<form id=form1 runat=server onsubmit=submitForm()>

More From » asp.net

 Answers
6

I'd bet you're doing this in your JavaScript:



FB.Event.subscribe('auth.login', function(response) {
window.location.reload();
});
FB.Event.subscribe('auth.logout', function(response) {
window.location.reload();
});


While the above code comes from the Facebook documentation, and it works for a standalone website implementing the Facebook JavaScript SDK, it will break your Facebook App in Internet Explorer and Firefox by causing an infinite loop.



When Facebook loads an App, it sends information about the user's authentication state via POST. The SDK processes this data and authenticates the user.



By telling the JavaScript SDK to reload the page upon successful authentication, Firefox and Internet Explorer interpret this to mean they should send the POST data again, too. Your App receives the POST data again, re-authenticates the user, and reloads the page, causing the infinite loop.



Solution: don't use window.location.reload(). Instead you'll need to set window.location.href (or otherwise strip the POST data from the browser request).


[#90670] Wednesday, August 10, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
keyonnaelled

Total Points: 35
Total Questions: 113
Total Answers: 99

Location: South Korea
Member since Fri, Sep 11, 2020
4 Years ago
;