• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
calling a function within a view?

#1
[eluser]tjackson1982[/eluser]
Hello all,

I'm hitting a wall. I'm trying to combine mootool ajax with CI and it doesn't seem to be working.

very simply I'm doing something like this.

Code:
<div id="headlines">

"<"script language="JavaScript"">"

$('headlines').load('index.php/Display/display_headline/');

"<"/script">"

</div>

basically I'm trying to capture the output of a function and just load the html returned and place it in that element.

Is this even possible? If not how can I do something similar? please simple examples...

Thanks,
Tom J.

#2
[eluser]majidmx[/eluser]
put the function in a library or plugin and easily call it from the View.
Like this :

Code:
$('headlines').load('&lt;?PHP echo my_lib_func();?&gt;');

Let me know if I got the idea wrong.

#3
[eluser]tjackson1982[/eluser]
I'm looking into it right now, but might take me some slight time to see if it is what I need.

Thanks for the suggestion.
Tom J.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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