Hi where should we put jquery file and how we import into our site
Page 1 of 1
jquery
#2
Posted 27 November 2008 - 08:40 PM
If you want to explicitly include jquery in your page, you can call the following:
Yii::app()->clientScript->registerCoreScript('jquery');
Yii::app()->clientScript->registerCoreScript('jquery');
#3
Posted 28 November 2008 - 07:32 AM
Quote
Hi where should we put jquery file
Also, notice that the jquery script is already bundled with Yii.
#5
Posted 17 December 2008 - 09:34 AM
Quote
what about the plugins?
Some are included, some others are extensions, and you could write your own wrapper extension for the plug-in you're interested in.
#6
Posted 22 April 2009 - 04:24 AM
I did not quite get it. If I need to use a JQuery plugin, for example Datepicker, which is actually a folder consisting of many .js and .css files. Where should I put it best in the files tree of the application? And how should I publish it? Thanks.
#7
Posted 22 April 2009 - 08:16 AM
Quote
I did not quite get it. If I need to use a JQuery plugin, for example Datepicker, which is actually a folder consisting of many .js and .css files. Where should I put it best in the files tree of the application? And how should I publish it? Thanks.
Well, for a datepicker, you can use this extension. Now, if you want to use another datepicker, I recommend you to write a Yii widget as a wrapper for it, so you don't have to work with javascript code directly in your view (you can take the extension as an example). But, if you still want to work with javascript code directly, you'll need to place the files you mention inside a directory and then publish that directory as an asset.
#9
Posted 08 November 2012 - 05:33 AM
I noticed that using registerCoreScript jQuery loads towards the bottom of the <head>. How can I make sure it loads first?
Share this topic:
Page 1 of 1

Help












