skip to Main Content

How to check if data returned from ajax as json is empty object or not – Jquery ajax

I have set this script for checking if the email address exists in the DB or not: function checkemail(){ var e = document.getElementById("email").value; if(e != ""){ document.getElementById("emailstatus").innerHTML = 'checking ...'; $.ajax({ type:'get', url:'{!! URL::to('checkEmailExists') !!}', data:{'email':e}, success:function(data){ // console.log(data); if(Object.keys(data).length…

VIEW QUESTION
Back To Top
Search