Yii Framework Forum: Using JQuery - Yii Framework Forum

Jump to content

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

Using JQuery Rate Topic: -----

#1 User is offline   NRaf 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 01-April 10

Posted 03 May 2010 - 02:23 AM

I'm sure this has been answered before but I've been searching and haven't come up with anything. I'm trying to use JQuery in my code. The way I'm importing it at the moment is as follows:
<script type="text/javascript" src = "<?php echo Yii::app()->request->baseUrl; ?>/assets/6d07a0e9/jquery.js"></script>

I'm doubtful if this is the way we're supposed to include JQuery, though. How should I be importing it?
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 03 May 2010 - 02:29 AM

<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>


And you are right: You should never do any manual includes from the assets folder.
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