Created 3 files:
- fn.php
- script.js
- index.php
In fn.php pasted the following code:
<?php if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'){ if (isset($_REQUEST['catname'])){ $catname = $_REQUEST['catname']; echo select_cat($catname); } } function select_cat($select_cat){ echo $select_cat; } ?> In script.js
function get_category(catname){ var catname = catname; $("#result").html('<img src="loader.gif" />'); $("#result").load("fn.php", { catname: catname }); } In index.php
<div class="r" onclick="get_category('catname');">Click Me</div> <div id="result"></div> This whole code works ... jQuery is connected ... Question: how to add the effect that say 1 div appears smoothly, or leaves ... in general, how to add an effect to the code and is it really possible to do it at all.