cavinz

Javascript : Get Credit card type from number

If we want to get credit card type from input number we have two methods https://jquerycreditcardvalidator.com/ ( from this url you can get the source and implement easily ) below is the function to fetch type <script type=”text/javascript”> function cardtype(number) { var re = new RegExp(“^4”); if (number.match(re) != null)...Read more …
dhavalp

Gloabal ajax request loader functionality

We can use defaul jQuery-ajax method for display ajax loader on multiple ajax request by using below formula. var activeAjaxCount = 0; $( document ).ajaxStart(function() { activeAjaxCount++; $(‘#msg_writter’).show(); }); $( document ).ajaxComplete(function() { activeAjaxCount–; if (activeAjaxCount == 0) { $(‘#msg_writter’).hide(); } });Read more …