Simple .debounce function
Used for delaying keypress searches, etc Usage example: Above will request /api/search endpoint 300ms after last keyup event
A bunch of ramblings about PHP programming, JQuery, MySQL and other 'stuff'
Used for delaying keypress searches, etc Usage example: Above will request /api/search endpoint 300ms after last keyup event
We’ve been using a bit of a google doc recently for logging stuff, and sometimes cells get missed. I wanted to just test out a bit of google doc and…
I recently had to create a site for an education facility, and they turn on Compatibility mode for all their networked PCs, for legacy support. This was messing around with…
Simple one. $(document).on('#element', 'keyup', function(event) { if (event.keyCode == 13) { event.preventDefault(); //do some other stuff } }); This doesn’t actually work as the Key Up event is too late…
So you want a little funky AJAX loader? Add this to your JS main core file…: $(document).ready(function() { //initiate an ajax start message $(document).ajaxStart(function() { //show the message $('#ajax_loading_indicator').show(); });…
Okay, so have you ever had a user call you up and say “the website is putting garbage into my notes” – and it turns out they are copying and…
I always end up leaving debug code in my pages for one reason or another. One of which is console.log() for the firebug extension. Now, if you leave this and…
Sometimes you want to pass a function around from script to script as a string containing the function name (well maybe not, but I have some legacy code that does…
When using JavaScript, you declare a variable using the var keyword. var myvariable = "a value"; These variables are globally accessible unless they are defined within a function. Javascript performs…
If like myself, you often attach functions to elements using jQuery, for example: $('.btnName').live('click', function() { //do something }); There is a nice little browser extension that will show all…