Jump to content

ajax return compare


DrTrans

Recommended Posts


 
$('#giftname').on('click', function() { 
 $(this).html("Searching..."); 
 var name  = $('#gift_name').val(); 
 $.get('../action.php', { action: "giftuuid",  giftname: name }, function(data) {
        giftitem(data);  
      });
 
})
 
function giftitem(data) { 
 

var nullkey = '00000000-0000-0000-0000-000000000000'; 
 
if(data == nullkey) { 
 
 alert("got a invalid key"); 

 } else { 
alert("got a valid key"); 
}
 
}
 
 

 

 

For some reason i get the got a valid key every time as if its not comparing the strings.

Link to comment
https://forums.phpfreaks.com/topic/287224-ajax-return-compare/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.