js anonymous function, when using it, just use the alert event directly
<script>functionalert(e){
$("body").append("<div id='msg'><span>"+e+"</span></div>");clearmsg();}functionclearmsg(){
var t =setTimeout(function(){
$("#msg").remove();},2000)};</script>