How To Fix “TypeError: Language code” JavaScript Errors in WordPress

Author: , January 20th, 2020

PROBLEM Wordpress site broken with Javascript errors with zero plugins or themes installed. The issue followed different devices, OS’es and different browsers. SOLUTION User account corrupted. The wp_usermeta locale field had an invalid value of “regular”, and nulling the field solved the issue. DETAILS JS console shows this:

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 Allow Cross-Site Javascript Using Apache

Author: , September 24th, 2015

The key is to send a response header like this: Access-Control-Allow-Origin: * In the Apache web server, one enables this via the following directive: Header set Access-Control-Allow-Origin * This requires the use of mod_headers, which is enabled by default in Apache. For example:

How To Fix JavaScript Floating Point Errors

Author: , February 27th, 2015

The .toFixed(2) method will round off the value of the field to 2 decimal places

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 Get the URL in Javascript Without the Query String

Author: , August 29th, 2013

window.location.href.split(‘?’)[0]

How To Modify the Menu Width in jQueryUI Autocomplete

Author: , June 18th, 2013

How To Add JavaScript or jQuery to a WordPress Page

Author: , October 4th, 2012

NO Blank Lines!

How To Round And Format Numbers In JavaScript

Author: , September 23rd, 2012

How To Get the Current URL in Javascript

Author: , September 6th, 2012

var pathname = window.location.pathname;