Search code examples
javascriptajaxhyperlinkprototypejs

How can I keep my Ajax call from posting back to the server when using Prototype?


I am trying to keep my Ajax call from posting back to the server when using Prototype.

Code:

echo " <a href='my.php?action=show&amp;id=".$fid."'
onclick=\"return  display('".$fid."');\"> ";  
echo "" .$fname."</a> ";

How can I do this?


Solution

  • Your display() function should return false; to prevent the default link action from happening.