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

[eluser]Robb__[/eluser]
I have tried a thing to control javascript actions:

Code:
var myAjax = new Ajax.Request('www/index.php/test/anAjaxCall/',{onComplete:test_response});

Code:
function anAjaxCall() {
$result ="testIfWorks('yes');";

return result;
}

in test_response
Quote:function test_response(){
eval(response.responseText)
}

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

Is there something missing or is it not possible?


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