nmathur
nmathur

Reputation: 433

Jquery ajax code and redirection code in one javascript code

I am writing a code in javascript (in .aspx page) which will insert values in database using jquery ajax code through webservice and then it will perform redirect operation, but it does not perform redirection .. please tell me if i am doing something wrong in my code ... here is my code ..

   <script type="text/javascript">

   function xyz()
   {
         $.ajax({
         type: "POST"
         url: "WebService.asmx/InsertRediretTime"
   });

   window.location='....location...';

   }
   </script>

Upvotes: 0

Views: 64

Answers (2)

Nam Nguyen
Nam Nguyen

Reputation: 61

 <script type="text/javascript">

   function xyz()
   {
         $.ajax({
         type: "POST"
         url: "WebService.asmx/InsertRediretTime"
   });

   window.location='....location...';
   return false;
   }
   </script>

try this

Upvotes: 0

MJC
MJC

Reputation: 3939

Have you tried window.location.href instead?

Upvotes: 1

Related Questions