Yii Framework Forum: Latest Yii: Problems With Jquery And Jquery-Ui - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Latest Yii: Problems With Jquery And Jquery-Ui Rate Topic: -----

#1 User is offline   blikkerdol 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 14-September 12

Posted 14 September 2012 - 08:03 AM

In one of my projects I was using YII 1.1.8 until now. However, when I upgraded to YII 1.1.12, suddenly jQuery's attr()-method appears to have been changed: it doesn't return strings anymore, but jQuery objects. At once all my javascripts where broken, since I rely heavily on attr().

Also I got pestered with a javascript error, complaining about a non existing method g.split() in jQuery-UI. This resulted in my jQuery-UI tabs not being generated anymore.

Needless to say I promptly downgraded to YII 1.1.8, so my scripts worked as expected again.

I hope this can be fixed?

Regards!
0

#2 User is online   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,085
  • Joined: 16-February 11
  • Location:Japan

Posted 14 September 2012 - 08:45 AM

View Postblikkerdol, on 14 September 2012 - 08:03 AM, said:

I hope this can be fixed?


I think Yii will (and should) keep integrating the latest stable versions of jQuery and jQuery UI.
So, generally speaking, if you want to continue to use the latest version of Yii, I think you have to update your code, instead of insisting Yii to use the outdated code.

One thing you can do right now is setting the script map like this:
Yii::app()->getClientScript()->scriptMap = array(
	'jquery.js' => 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.x/jquery.min.js',
	'jquery.min.js' => 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.x/jquery.min.js',
	'jquery-ui.min.js' => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.xx/jquery-ui.min.js',
);

By doing this kind of thing, you will be able to use the latest Yii with the older versions of jQuery and jQuery UI.

But in the long run, you may encounter a compatibility issue even with this workaround, anyway.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users