Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.72 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. JQM: Redirect after Ajax form post
  2. function submitForm()
  3.     {
  4.             $.ajax(
  5.             {
  6.                 type:'POST',
  7.                 url:'form.php',
  8.                 data:$('#form').serialize(),
  9.                 success:function(response)
  10.                 {
  11.              /////////////
  12.                     $.mobile.changePage('#page1', {
  13.                             reloadPage: true
  14.                         }, {
  15.                             allowSamePageTranstion: true
  16.                         }, {
  17.                             transition: 'none'
  18.                         });
  19.                     return false;
  20.              /////////////
  21.                 }
  22.             }
  23.         );
  24.     }
  25.        
  26. window.location.href="redirect url"