DrTrans Posted March 24, 2014 Share Posted March 24, 2014 $('#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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.