I am trying to get CakePHP working with JQuery. Below is the div that I have in place, and all I am trying to do is simply alert("CLICKED!"); whenever the below link is clicked.
<?php echo $this->Html->link('Link Click Me', '#', array('onclick'=>'return false;', 'id'=>'divId', 'class'=>'divClass')); ?>
I have the following files 'jquery-1.5.2.js' and 'js_file.js' in the 'js' directory of the 'webroot' folder in my project, and JQuery is working, but I cant seem to get this particular functionality working.
Any suggestions??
Code for jquery:
$(document).ready(function(){
$('.divClass').click( function(){
alert("TESTING!");
});
});
And this is the view:
<?php echo $this->Html->link('Link Click Me', '#', array( 'id'=>'divId', 'class'=>'divClass')); ?>
I am still looking for an answer to this question guys....
onclick="return false;"from the link? It might interfere with the jQuery click event.