Ajax函数退出?

Why do people write 'exit' after the ajax function calls end

function ajaxValidate($params)
{
  // echo something
  exit;
}

When the function blocks end the code executions stops at server side so why break the code manually ?

The function will be called via the server-side framework, be it Joomla, Yii or anything else. So after the function returns, the framework continues to run to completion. In a cleanly designed framework, exit statement is not required as you rightly point out.

If the programmer does not understand the framework well and wants to play it safe, or has seen redundant exit values appearing the output, he/she may add the exit statement.