Posts

Showing posts with the label Javascript

Javascript Error: Uncaught ReferenceError: ga is not defined at HTMLImageElement.onload

Image
Hi, I found this error on my Jquery Page.  Uncaught ReferenceError: ga is not defined     at HTMLImageElement.onload  I added this below script now it has been solved  window['GoogleAnalyticsObject'] = 'ga';   window['ga'] = window['ga'] || function() {     (window['ga'].q = window['ga'].q || []).push(arguments)   };

Phone Number Validate JQuery

This script will check following thing in Phone Phone is not String Phone number must not starting with 0 or 1 jQuery('#phone').keyup(function (e) { var phonevalidate = jQuery('#phone').val();     var checkfirstval = phonevalidate.charAt(0); if(checkfirstval==0 || checkfirstval==1){ jQuery('#phone').val(''); } var regEx=/[^0-9]/; var checkstring = regEx.test(phonevalidate); if(checkstring){ jQuery('#phone').val(''); } }); Note: Here input id is phone .