• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What's the best way to work with jquery plugins ?

#1
[eluser]chefnelone[/eluser]
Hello

I use to work with jquery plugins.
Usually I load them in my view page (let say index.php).

I'm just wondering if is there a better way to load a jquery plugin.

Let's say I use to work with just 1 of 2 menu plugins: menu1 and menu2.
For them I have the folders: Menu1 and Menu2 and inside of each one the js and css files to make the plugin works.

At the moment I choose one of them I insert the path in view/index.php:

<link rel="stylesheet" href="<?php echo base_url();?>plugins/Menu1/menu1.css" />
[removed] [removed]

or:

<link rel="stylesheet" href="<?php echo base_url();?>plugins/Menu2/menu2.css" />
[removed] [removed]

My question is: is there a better way to work with this kind of plugins. Maybe saving them in a folder and then loading then from a controller ?

hope someone understand what I mean...
Thanks

#2
[eluser]CroNiX[/eluser]
Yes, there are asset managers which can do that for loading css/js/metadata into the head of the document at runtime based on the config file or what you tell it to directly from the controller. Very handy.

Here is one:
http://ellislab.com/forums/viewthread/101236/

There are more but I haven't personally used them.

#3
[eluser]garymardell[/eluser]
Personal favourite is:
http://codeigniter.com/wiki/Carabiner/

#4
[eluser]chefnelone[/eluser]
both of them looks really good, I think I will try Carabiner .
thanks

#5
[eluser]Unknown[/eluser]
It was my problem too.

Thank u Smile

#6
[eluser]umefarooq[/eluser]
Carabiner is the best solution for these stuff, you can use css or js if it is required for some section.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.