programAngel Posted March 11, 2012 Share Posted March 11, 2012 I have written the page in the link in the next line:http://barzilaymor.c...us/DiurPlus.php In the bottom of the code I have used a jquery command that create a listener to a click event. But it rum the function automatically after the page finished to load regardless of any click.I talk about this following command. $('#next-page').on('click',changepage( 2 )); the changepage function is executed immediately after the page is finished to load. What is the reason for this behavior and how can I solve it? Link to comment Share on other sites More sharing options...
dsonesuk Posted March 11, 2012 Share Posted March 11, 2012 That jquery is used for window event and usually applied $('#next-page').on('click',changepage); what you require is below $('#next-page').bind('click', function() { changepage( 2 );}); Link to comment Share on other sites More sharing options...
programAngel Posted March 11, 2012 Author Share Posted March 11, 2012 That jquery is used for window event and usually applied $('#next-page').on('click',changepage); what you require is below $('#next-page').bind('click', function() { changepage( 2 );}); Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.