jQuery plugin to sorts DOM elements within common parent
A small script that sorts DOM elements within common parent. Example: https://jsfiddle.net/DotMaui/8wq49vbm/17/ Free CDN: https://cdn.dotmaui.com/dotmaui/js/orderfy.min.js
A small script that sorts DOM elements within common parent. Example: https://jsfiddle.net/DotMaui/8wq49vbm/17/ Free CDN: https://cdn.dotmaui.com/dotmaui/js/orderfy.min.js
$(“#mydiv”).prepend(“<div class=’child’>.Maui is awesome!</div>”);
$.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
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…
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…
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…
With a small snippet of jQuery code you can detect whether the user is viewing the site from a mobile device. The script can be downloaded from http://detectmobilebrowsers.com/download/jquery or copied from below: var isMobile =…
To check if an item is present in the DOM using jQuery, it is sufficient to use the length property, like this: if ($(‘#myElement’).length) { // Exists } else { // Not Exists } Or…
A small plugin for jQuery, by Sam Sehnert, that checks whether elements are within the user visible viewport of a web browser. Only accounts for vertical position, not horizontal. (function ($) { /** * Copyright…