I am using zend framework on windows. I want to implement ajax in my project first time. I searched for help and created a very simple ajax functionality.
In
for simple loading of data in divs i would use the load method
HTML
One
Two
one.phtml content comes here
two.phtml content comes here
JS
jQuery(document).ready(function(){
jQuery('.ajax').click(function(event){
event.preventDefault();
var target = '#' + jQuery(this).attr('rel');
var href = jQuery(this).attr('href');
jQuery( target ).load( href );
});
});
Use a single class to identify all links that should use ajax calls instead of their normal use. And add a rel attribute to those links that will contain the id of the container div..