Welcome Guest, Not a member yet? Register   Sign In
Javascript call from controller result possible?
#3

[eluser]obiron2[/eluser]
the javascript is running client side.

if you are doing

Code:
function testIfWorks(text){
if (text == "yes") {alert('yep, that did the job')}
}

in your controller/model this is running server side and will do nothing. If you are doing it client side in the #script# tags then text has not been set becuase "return $resul" is only adding $result to the CI object, it is not actually sending it via HTTP. You still need to generate the output using an echo, print or $this->view('your_view',$data) construction.

hope this helps

obiron


Messages In This Thread
Javascript call from controller result possible? - by El Forum - 09-15-2007, 06:59 AM
Javascript call from controller result possible? - by El Forum - 09-15-2007, 10:17 AM
Javascript call from controller result possible? - by El Forum - 09-17-2007, 05:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB