sourcebitsllc / chocolatechip-ui

Mobile Web App Framework
www.chocolatechip-ui.com
MIT License
617 stars 88 forks source link

Cannot read property 'classList' of null #69

Closed jeff183 closed 10 years ago

jeff183 commented 10 years ago

I am on an android device, working fine with 3.5.2. i upgraded to 3.5.5 to use the carousel widget and this works fine on the desktop. however, on the device i get this error:

file:///android_asset/www/assets/js/chui-3.5.5.min.js: Line 8 : Uncaught TypeError: Cannot read property 'classList' of null

jeff183 commented 10 years ago

changed to the non-minified js, so the error is on line 258:

document.body.classList.add('isNativeAndroidBrowser');

file:///android_asset/www/assets/js/chui-3.5.5.js: Line 258 : Uncaught TypeError: Cannot read property 'classList' of null

SenthilKaliathan commented 10 years ago

I am also facing the script error "Uncaught TypeError: Cannot read property 'classList' of null" at line: document.body.classList.add('isNativeAndroidBrowser');

I am using UISearch widget in Android JellyBean 4.2.

screen shot 2014-06-20 at 12 00 37 pm

jeff183 commented 10 years ago

Robert fixed it. He will add the fix into 3.5.6. For now you can do this: In Chui JS: Move lines 254- 259 to line 276.

So cut this from line from lines 254-259: ////////////////////////////////// // Flag if native Android browser: ////////////////////////////////// if ((/android/img.test(navigator.userAgent)) && (/webkit/img.test(navigator.userAgent) ) && (!/Chrome/img.test(navigator.userAgent))) { document.body.classList.add('isNativeAndroidBrowser'); }

and paste right after the $(function() { on line 275

sourcebits-robertbiggs commented 10 years ago

This fix is checked in: a8f9d7b091c0adb425662335212749df05a7211b