Last modified: 2014-03-01 17:31:11 UTC
On a Kindle Keyboard (Kindle 3) running software version Kindle 3.4: use "Search Wikipedia" and enter "King James". The resulting article is en.m.wikipedia.org/wiki/King_James and displays fine, but at the bottom, just below the "Read in another language" link, the error message mobile-frontend-last-modified-months: Result of expression 'rule.split('@')[0].trim' [undefined] is not a function is displayed.
Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim the String.trim method wasn't added until a relatively recent version of JavaScript, so it may not be available on the Kindle's older browser. Unless there's a polyfill being used, avoid it in generic-ish code... Looks like it's being used in core, in resources/mediawiki.libs/CLDRPluralRuleParser.js Will fire up the test Kindle 3 once it's charged and see if it works with that replaced with a regex.
Created attachment 14723 [details] screen photo of error note JavaScript must be enabled for the error to occur
There is $.trim which should be used instead.
(In reply to Bartosz Dziewoński from comment #3) > There is $.trim which should be used instead. The upstream code in https://github.com/santhoshtr/CLDRPluralRuleParser doesn't seem to have any explicit jQuery dependency, so I'd rather not add that here.
Change 116159 had a related patch set uploaded by Brion VIBBER: Fix for CLDR plural rule parser for old browsers without String.trim https://gerrit.wikimedia.org/r/116159
Change 116159 merged by jenkins-bot: Fix for CLDR plural rule parser for old browsers without String.trim https://gerrit.wikimedia.org/r/116159
Ok fix is merged in MediaWiki core and in the lib upstream repo. It should wander into the live site within a couple weeks.