i want to manipulate by the value which was send by php.. but the ajax is not working properly
<p>From javascript code by onclick i call a function and sending the value through ajax to another php page.. simply make it as "s". if the sending value was "s" it want to show as "success" else "fail" but i'm getting "fail" for all correct and non correct inputs..</p>

<p>Javascript Code:</p>

<pre><code>function asd()
  {
     var uname=document.getElementById("uname").value;
     var pass=document.getElementById("password").value;
     $.post("vi.php",{uname:uname,pass:pass,rand:Math.random() },
         function(data)
             {  
            /*type:"POST",
            url:"vi.php?uname="+uname+"&amp;pass="+pass,

            success:function(data)
                {
              if(data=='s')
                 {
                 alert("sccess");
                 }
             else
                 {
                 alert("faile");
                 }
                }
     */
       alert(data);
       if(data=="s")
      {
             alert("hello");
      }
      else
      {
              alert("fail");
      }

   });
    }
</code></pre>

<p></p>

<p>PHP  CODE:</p>

<pre><code>   &lt;?php

      $a=$_POST['uname'];
      echo $a;


   ?&gt;
</code></pre>

<p>OUTPUT Was:</p>

<p>Message Box "Fail" for all inputs...</p>
