Author:
erics , 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:
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
[ Error ] TypeError : Language code must have format 2 - 3 letters and . optionally , hyphen , underscore followed by 2 more letters
language ( mediaelement - and - player . min . js : 12 : 7263 )
( anonymous function ) ( mediaelement - and - player . min . js : 12 : 14817 )
d ( mediaelement - and - player . min . js : 12 : 259 )
r ( mediaelement - and - player . min . js : 12 : 414 )
Global Code ( mediaelement - and - player . min . js : 12 : 430 )
[ Error ] ReferenceError : Can 't find variable: MediaElementPlayer
(anonymous function) (mediaelement-migrate.min.js:1:363)
Global Code (mediaelement-migrate.min.js:1:1179)
[Error] TypeError: undefined is not a function (near ' . . . ) . mediaelementplayer ( e ) } } } , n ( e . wp . mediae . . . ')
initialize (wp-mediaelement.min.js:1:855)
i (load-scripts.php:2:27368)
fireWith (load-scripts.php:2:28123)
ready (load-scripts.php:2:29926)
J (load-scripts.php:2:30282)
[Error] TypeError: undefined is not an object (evaluating ' d . hasClass ')
( anonymous function ) ( wp - auth - check . min . js : 1 : 1538 )
dispatch ( load - scripts . php : 3 : 12375 )
handle ( load - scripts . php : 3 : 9094 )
trigger ( load - scripts . php : 3 : 11494 )
trigger ( load - scripts . php : 8 : 8280 )
( anonymous function ) ( load - scripts . php : 3 : 18873 )
each ( load - scripts . php : 2 : 2908 )
each ( load - scripts . php : 2 : 851 )
trigger ( load - scripts . php : 3 : 18846 )
( anonymous function ) ( heartbeat . min . js : 1 : 2228 )
i ( load - scripts . php : 2 : 27368 )
fireWith ( load - scripts . php : 2 : 28123 )
x ( load - scripts . php : 4 : 22587 )
c ( load - scripts . php : 4 : 26778 )
Categories: How-To's , Technology Tags: Error , Errors , javascript , JS , Locale , TypeError , WordPress
| No comments
Author:
erics , March 20th, 2018
window.scrollTo(x-coord, y-coord); Example: window.scrollTo(0,0);
Categories: How-To's , Technology Tags: howto , javascript , JQuery , JS , Scroll , ScrollTo , tips
| No comments
Author:
erics , 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:
LoadModule headers_module modules / mod_headers . so
. . .
< VirtualHost * : 80 >
ServerName www . your . domain
ServerAlias * your . domain
DocumentRoot / var / www / yourdomain
DirectoryIndex index . php index . html
Header set Access - Control - Allow - Origin *
< / VirtualHost >
Categories: How-To's , Technology Tags: Access-Control-Allow-Origin , ajax , apache , cross , cross-site , cross-site javascript , headers , howto , http , javascript , Load , mod_headers , tips , xsite
| No comments
Author:
erics , February 27th, 2015
The .toFixed(2) method will round off the value of the field to 2 decimal places
decimalNumTwoPlaces = parseFloat ( this . value . toFixed ( 2 ) ) ;
Categories: How-To's , Technology Tags: Decimal , Floating , Floating Point , howto , javascript , Round , Rounding , tips , toFixed
| No comments
Author:
erics , 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/
Categories: How-To's , Technology Tags: bug , Bugfix , howto , javascript , JQuery , JS , tips
| No comments
Author:
erics , August 29th, 2013
window.location.href.split(‘?’)[0]
Categories: How-To's , Technology Tags: howto , javascript , Query , Query String , tips , URL
| No comments
Author:
erics , June 18th, 2013
open : function ( event , ui ) {
jQuery ( '.ui-menu' ) . width ( '220px' ) . css ( 'text-align' , 'left' ) ;
}
Categories: How-To's , Technology Tags: Auto , Autocomplete , Dropdown , howto , javascript , JQuery , jQuery UI , Menu , tips , Width
| No comments
Author:
erics , October 4th, 2012
NO Blank Lines!
<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>
Categories: How-To's , Technology Tags: howto , javascript , JQuery , Script , tips , WordPress
| No comments
Author:
erics , September 23rd, 2012
var num = 10 ;
var result = num . toFixed ( 2 ) ; // result will equal 10.00
var num = 170.2305 ;
var result = num . toFixed ( 3 ) ; // result will equal 170.231
Categories: How-To's , Technology Tags: Decimal , Format , Format Number , howto , javascript , JS , Number , Number Format , Places , Round , Rounding , tips , toFixed
| No comments
Author:
erics , September 6th, 2012
var pathname = window.location.pathname;
Categories: How-To's , Technology Tags: howto , javascript , Location , PathName , tips , URL , window.location
| No comments