SammyLin / redactor-rails

This repo is deprecated. Please check out official gem for Redactor 2. https://github.com/Redactor2/redactor2_rails
MIT License
389 stars 253 forks source link

Uncaught TypeError: Cannot read property 'msie' of undefined #41

Open holgersindbaek opened 11 years ago

holgersindbaek commented 11 years ago

I followed the instructions to the point, but I keep getting this error: Uncaught TypeError: Cannot read property 'msie' of undefined

The full error is as such: Uncaught TypeError: Cannot read property 'msie' of undefined a.buildColorPicker (anonymous function) proxy jquery.js:802 jQuery.extend.each jquery.js:632 a.buildToolbar a.init a (anonymous function) jQuery.extend.each jquery.js:632 jQuery.fn.jQuery.each jquery.js:254 jQuery.fn.redactor (anonymous function) config.js:9 fire jquery.js:1018 self.fireWith jquery.js:1128 jQuery.extend.ready jquery.js:417 DOMContentLoaded jquery.js:93

If I take redactor complete away, the error disappears. Am I doing something wrong or is it an actual error?

konclave commented 11 years ago

Seems that you have installed latest jQuery release (1.9) In jquery 1.9 $.browser feature is deprecated and redactor uses it somewhere. So the solution is to roll back to jquery 1.8.something

holgersindbaek commented 11 years ago

Hmm... doesn't seem like the best solution, but ok. How would you roll back to 1.8 with the rails gem?

isqad commented 11 years ago

You should use modernizr for detect browser.

holgersindbaek commented 11 years ago

And how would I do that? Just include the modernizr library in my library and that's it?

konclave commented 11 years ago

Modernizr is not your case because it's not browser detection utility but feature detection. And it won't help you because it wouldn't make redactor-rails work. At first you should determine how do you include jquery in your rails app. If it is a gem, you should set the gem version in your gemfile. If it is just an include of jquery.js in a template, you should dowload the 1.8.3 jquery and replace your current jquery.js by 1.8.3