In my CakePHP view, I call method in controller, using jQuery:
function placeSensors(nk) { $.ajax({ type:'post', url:'/myapp/maps/placeSensors/' + nk, success: function(r) { if(r.status = 'ok') { } } }); } JS in controller is defined with ie.:
class MapsController extends AppController { var $name = 'Maps'; var $helpers = array('Js'); var $uses = array('Measurings', 'Maps'); var $components = array('RequestHandler'); // added later, but still the same function index( $id = null, $value = null ) { $code = ''; ?> <script type="text/javascript"> alert('Hello!'); </script> <?php return $code; } So, with simple code, I can not get alert message on my web form. Very simple code I was using in some other project and it works there, and for some reason this does not work on this one...
I'm really stuck with this one, can you please help me.....
UPDATE: this is response i'm getting by Firebug:
<script type="text/javascript"> alert('Hello!'); </script>