title: Parameters in AJAX PHP callback function
body: <p>I am using the below AJAX script to process some operation.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function validLogin(){
    var uname=$('#uname').val();
    var password=$('#password').val();
  
    var dataString = 'uname='+ uname + '&amp;password='+ password;
    $("#flash").show();
    $("#flash").fadeIn(400).html('&lt;img src="http://www.91weblessons.com/demo/phpAjaxLoginValidation/image/loading.gif" /&gt;');
    $.ajax({
    type: "POST",
    url: "processed.php",
    data: dataString,
    cache: false,
    success: function(result){
             var result=trim(result);
             $("#flash").hide();
             if(result=='correct'){
                   window.location='update.php';
             }else{
                   $("#errorMessage").html(result);
             }
    }
    });
  }
  
  function trim(str){
   var str=str.replace(/^\s+|\s+$/,'');
   return str;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Here I need to redirect to a dynamic URL <code>update.php?name=somename</code> after success.</p>
  
  <p>Please give any suggestions.</p>