How To Scroll to the Top of the Page using Javascript

Author: , March 20th, 2018

window.scrollTo(x-coord, y-coord); Example: window.scrollTo(0,0);

How To Fix WordPress 3.8 Bugs

Author: , January 29th, 2014

Edit the wp-config.php file in the root of your WordPress Install. Search for this line: require_once(ABSPATH . ‘wp-settings.php’); Just before it add this line: define(‘CONCATENATE_SCRIPTS’, false ); Save, exit and refresh the page in your browser. It would also be a good idea to empty your browser cache. Original Post: http://www.carnfieldwebdesign.co.uk/blog/wordpress-fix-add-media-button-not-working/

How To Modify the Menu Width in jQueryUI Autocomplete

Author: , June 18th, 2013

1 2 3 open: function( event, ui ) {     jQuery(’.ui-menu’).width(’220px’).css(’text-align’, ‘left’); } open: function( event, ui ) { jQuery(‘.ui-menu’).width(’220px’).css(‘text-align’, ‘left’); }

How To Create a Responsive Table Using jQuery

Author: , April 19th, 2013

The jQuery 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 jQuery(document).ready(function() {     function watchWindow() {   […]

How To Download a File Using jQuery

Author: , December 16th, 2012

Here is a link to the original article by the Filament Group. I posted the code below just so I have it handy… 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <script> jQuery.download = function(url, data, method){     //url and data options required   […]

How To Add JavaScript or jQuery to a WordPress Page

Author: , October 4th, 2012

NO Blank Lines! 1 2 3 4 5 6 7 8 9 10 11 <script type="text/javascript"> <!– jQuery(document).ready(function(){  jQuery(’#yourForm’).on(’submit’, function(e){    if (jQuery(’#yourInput’).val() < 1) {       alert(’Please enter a whole number greater than 0′);       return false;    }  }); }); //–></script> <script type=”text/javascript”> <!– jQuery(document).ready(function(){ jQuery(‘#yourForm’).on(‘submit’, function(e){ if (jQuery(‘#yourInput’).val() […]

How To Sum the Values of Form Fields

Author: , October 3rd, 2012

1 2 3 4 5 6 7 8 9 10 var sum = 0; // loop through each field jQuery(".sum").each(function() {    //add only if the value is number    if( ! isNaN(this.value) && this.value.length != 0 ) {       sum += parseFloat(this.value);    } }); //.toFixed() rounds the sum to 2 decimal […]

How To Get the HTML Tag Name of an Element Using jQuery

Author: , September 8th, 2012

var Tag = jQuery(‘yourElementSelector’).get(0).tagName.toLowerCase(); Note: nodeName also works in place of tagName!

How To Get the Value of a Checked Radio Button in a Specific Form

Author: , September 7th, 2012

How To Get the Value of a Selected Radio Button in a Specific Form: jQuery(‘input[name=radioName]:checked’, ‘#yourForm’).val()

How To Reload a Page Using JQuery or JavaScript

Author: , September 6th, 2012

location.reload(); ~or~ window.location = window.location.pathname;