Welcome Guest, Not a member yet? Register   Sign In
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.




Theme © iAndrew 2016 - Forum software by © MyBB