I do not understand why this works in Chrome but not Firefox

63
January 19, 2019, at 3:40 PM

I have, what I believe to be, a decent validation script that ensures the user enters an email and that the email if from a selected domain.

This code works well in Chrome and Safari without any errors but it will not execute in Firefox.

Can someone please enlighten me?

$("#email").keyup(function() { 
  if (this.value.length <= 0) { 
    email = 0; 
    $(this).removeClass('success_class'); 
    $(this).addClass('error_class'); 
    document.getElementById("emailError").innerHTML = "You need to enter your email"; 
  } else if (!/\@(gmail\.net|yahoo\.com|hotmail\.com)$/i.test(this.value)) { 
    email = 0; 
    $(this).removeClass('success_class'); 
    $(this).addClass('error_class'); 
    document.getElementById("emailError").innerHTML = "You must enter your @gmail.net, @yahoo.com or @hotmail.com email"; 
    document.getElementById("x").style = "display:none"; 
  } else { 
    email = 1; 
    $(this).removeClass('error_class'); 
    $(this).addClass('success_class'); 
    document.getElementById("emailError").innerHTML = ""; 
    document.getElementById("x").style = "display:block"; 
  } 
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> 
<label>Your Email: 
        <input id="email" type="email" name="email" placeholder="Email" required/> 
    </label> 
<div id="emailError" style="color:#fff;background:#990000;"></div>

READ ALSO
GCloud AppEngine nodejs application returns 404 on first requests but subsequent ones are successful

GCloud AppEngine nodejs application returns 404 on first requests but subsequent ones are successful

I am deploying a nodejs server (graphql) application on GCloud AppEngine standard environment and occasionally the first requests fail but the subsequent ones (within 5s) workI am using the following configuration:

31
How to get all the posts uploaded by the users followed with MongoDB

How to get all the posts uploaded by the users followed with MongoDB

My application allows users to create simple posts, which are saved a collection of MongoDB called "posts"What I would like to get is a search query that allows me to get user posts followed by the user making the request to the server

53
Problems to append tuples from a list to another and print it

Problems to append tuples from a list to another and print it

I'm trying to print an list of tuples by comparing the tuple first item to a specified int() but by some mystery reason the tuples with 0 in second term just disappear

36
Extracting data from database Flask-SQLalchemy? is it possible to import the data to shelve python?

Extracting data from database Flask-SQLalchemy? is it possible to import the data to shelve python?

What im confused about is how do I extract a certain user information via databasepy so I can use those on other pages, does it have something to do with the current_user

39