Guest User

Untitled

a guest
May 27th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. function test(x) {
  2. new Ajax.Request('/ajax.php',{
  3. method:'get',
  4. parameters: {user: "register", namecheck: v},
  5. onSuccess: function(transport){
  6. var json = transport.responseText.evalJSON();
  7. return ((json.istaken == 0) ? false : true); // This is what I need to return from test(x)
  8. },
  9. onFailure: function(){
  10. alert('Something went wrong...');
  11. return false; // Or this, in case of an error
  12. }
  13. });
  14. return false;
  15. }
Add Comment
Please, Sign In to add comment