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 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 Round And Format Numbers In JavaScript

Author: , September 23rd, 2012

How To Install LESSC Using node.js

Author: , April 26th, 2012

I did this as root. YMMV… gem uninstall less (just in case you used the old way…) git clone git://github.com/ry/node.git (or use wget http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz; tar xvzf node-*) cd node ./configure make make install cd .. curl http://npmjs.org/install.sh | sh npm install less ln -s /usr/lib/nodejs/less/bin/lessc /usr/bin/lessc

How To Escape Newlines In PHP For Javascript

Author: , January 11th, 2012

You must use all three lines together for it to work…YMMV:

How To Use Regular Expressions In JavaScript

Author: , November 3rd, 2011

RegExp.exec(string) Applies the RegExp to the given string, and returns the match information.

match then contains [“Sample”,”amp”] RegExp.test(string) Tests if the given string matches the Regexp, and returns true if matching, false if not.

match then contains false String.match(pattern) Matches given string with the RegExp. With g flag returns an array containing the […]

How To Validate Passwords Using jQuery

Author: , October 19th, 2011

The ability to validate BEFORE a form is submitted greatly reduces end-user frustration by telling the user immediately what the issue is. The jQuery Validation plugin does just that. Here is a link to the plugin’s home page: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ This is a simple recipe for doing custom password validation: In the html head

In […]

How To Use a Spinner With jquery.pager

Author: , September 26th, 2011

Just an addendum to the previous post about ajax loader spinner images…

How To Implement A Very Simple Ajax Loader Using jQueryUI

Author: , September 23rd, 2011

GET Resources http://code.jquery.com/jquery-1.6.4.min.js http://jqueryui.com/resources/download/jquery-ui-1.10.1.custom.zip LOAD Resources

HTML Substitute your own loader graphic from http://www.ajaxload.info/

CSS

JS Show the spinner called “first”: jQuery(‘#Spinner-first’).fadeIn(); Hide the spinner called “first”: jQuery(‘#Spinner-first’).fadeOut(); Hide all spinners that start with an ID of “Spinner”: jQuery(‘[id^=Spinner]’).fadeOut(); That’s All Folks…