<script type="text/javascript"> function doAction(postid,type){ $.post('doAjax.php',(postid:posid,type:type),function (data){ $('#'+postid+'_'+type+'#').text(data); }); } </script>