Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi In my web application i will use javascript for call webservice for some transaction in database and i redirect to logout page in javascript itself.Here is my code

JavaScript
function RedirectToLogin() {
           var UserName = document.getElementById("MasterUser").value;
           SuperFastWS.FnLogout(decodeURI(UserName));
         //alert("Hai")
            window.location = "logout.aspx";
       }


in Mozilla only fastly go to
JavaScript
window.location


it will not go to FnLogout function in webservice,in FnLogout function i write insert query,in IE and Chrome call that function and execute that query,but in Mozilla only fastly process and go window.location line so FnLogout function not tigger,
if i put alert msg after calling webservicce then only it tigger FnLogout function in mozilla.i don't know why if have some little bit delay time then only tigger FnLogout function in Mozilla browser,

Pls tell me how to solve this problem without use alert msg
Posted
Updated 27-Jun-14 21:13pm
v2

1 solution

Hi Finally i got solution form this link

http://www.tutorialspoint.com/javascript/javascript_page_redirect.htm[^]


just i add setTimeout call redirect to other page after calling webservice method,so it have some time to tigger

JavaScript
function RedirectToLogin() {
         var UserName = document.getElementById("MasterUser").value;
         SuperFastWS.FnLogout(decodeURI(UserName));
         setTimeout('Redirect()', 5);
      }

      function Redirect() {

          window.location = "logout.aspx";
      }


So above setTimeout i will get some 5 micro milli secs to wait and call redirect to other page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900