Welcome Guest, Not a member yet? Register   Sign In
Dynamics load content using jQuery plugin
#1

[eluser]Unknown[/eluser]
Hi,
I have an idea for dynamic loading content using jQuery plugin, because I have many clients and websites where I'm using loading content to page elements using Ajax (jQuery).

I can write jQuery plugin for loading pages in CodeIgniter, but I can't write any class (plugin) to the CodeIgniter.

My idea:

1) First step will be an uploading jQuery plugin to js folder (or any other folder name) placed in root.
2) Loading plugin in controller class using code like:
Code:
$this->jquery->load('js/jQuery.load.js');
3) And with <a href="#">...</a> links use the syntax like
Code:
onclick="&lt;? $this->jquery->load('&lt;? echo base_url(); ?&gt;index.php/some_controller','#pageContent'); ?&gt;"
or
Code:
rel="jQuery.load,&lt;? echo base_url(); ?&gt;index.php/some_controller,#pageContent"
Where first (second) parameter will be a page URL to load and second parameter will be HTML element to load content page. And some other parameters like effect while loading etc.

My question is a how can I write any CodeIgniter class for using this plugin?

Thanks a lot for answers...

... sorry for my english ;-) ...
#2

[eluser]Damien K.[/eluser]
Your problem is fuzzy, maybe due to your English skills. I think your problem is with trying to load a JavaScript file from within your controller. JavaScript is a view component so usually you would handle the loading of the js file in your view and not in your controller.




Theme © iAndrew 2016 - Forum software by © MyBB