if condition not working properly
Hi,
I am using below code the data form other page coming properly but while i am showing this in html page, the if condition is not working properly, whatever the result it going only with the if condition not in the else condition.
both the time code of if part is working
- $(document).ready(function()
- {
- $.post("check_user.php",{uname:uname},
- function(data)
- {
- alert(data);
- if(data=uname)
- {
- alert("Already exit pls change!");
- $("#user_name").val('');
- $("#user_name").focus();
- }
- else
- {
- alert(data);
- }
- });
- });
Thanks