Guest User

Untitled

a guest
Aug 8th, 2018
1,280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. check json availablility
  2. function isUniqueEmail(email) {
  3. $.getJSON('info/mail.json', function(json) {
  4. var response = json.mail
  5. if(response == email){
  6. alert("Your email is already on our list");
  7. }
  8.  
  9. else {
  10. emailWrite(email);
  11. };
  12. });
  13. };
  14.  
  15. {"mail":
  16. [
  17. ]}
  18.  
  19. function isUniqueEmail(email) {
  20. $.getJSON('info/mail.json', function(json) {
  21. var response = json.mail
  22. $(json).each(function(){
  23. if(this.mail == email){
  24. alert("already gotcha")
  25. }
  26. else {emailWrite(email)
  27. }
  28. });
  29. });
  30. };
  31.  
  32. $(json).each(function(){
  33. if(this.mail == email){
  34. // already on list
  35. }else{
  36. // writeEmail
  37. }
  38. });
Add Comment
Please, Sign In to add comment