Get query string parameters with jQuery

$.urlParam = function (name) { var results = new RegExp(‘[\?&]’ + name + ‘=([^&#]*)’) .exec(window.location.href); if (results == null) { return 0; } return results[1] || 0; } console.log($.urlParam(‘dotmaui’)); //cool

Examples of Ajax requests with jQuery

jQuery simplifies our life a lot, even with Ajax requests, here’s an example of a basic request: $.ajax({ url: ‘myfile.php’, success:function(data){ alert(data); } }); This is the simplest possible Ajax request, if our request is…

SambucaJS – jQuery plugin

Small jquery plugin that adds some functionality to jquery, eg: Check if an item is empty Check whether an item exists Take a parameter in the querystring of the current Web page. /*! * jQuery…

jQuery – Textbox accept only numbers

Implement a functionality for a textbox to allow only numbers in jQuery: $(‘.only-digits’).on(‘keypress’, function (e) { if ((e.keyCode < 48) || (e.keyCode > 57)) { return false; } }); Remains the problem that you can…