Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- check json availablility
- function isUniqueEmail(email) {
- $.getJSON('info/mail.json', function(json) {
- var response = json.mail
- if(response == email){
- alert("Your email is already on our list");
- }
- else {
- emailWrite(email);
- };
- });
- };
- {"mail":
- [
- "tom@gmail.com",
- "fred@gmail.com",
- "bob@gmail.com"
- ]}
- function isUniqueEmail(email) {
- $.getJSON('info/mail.json', function(json) {
- var response = json.mail
- $(json).each(function(){
- if(this.mail == email){
- alert("already gotcha")
- }
- else {emailWrite(email)
- }
- });
- });
- };
- $(json).each(function(){
- if(this.mail == email){
- // already on list
- }else{
- // writeEmail
- }
- });
Add Comment
Please, Sign In to add comment