It has passed the test under IE8 and firefox3.0.11.
Copy codeThe Code is as follows:
$. Extend ({
IncludePath :'',
Include: function (file)
{
Var files = typeof file = "string "? [File]: file;
For (var I = 0; I <files. length; I ++)
{
Var name = files [I]. replace (/^ \ s | \ s $/g ,"");
Var att = name. split ('.');
Var ext = att [att. length-1]. toLowerCase ();
Var isCSS = ext = "css ";
Var tag = isCSS? "Link": "script ";
Var attr = isCSS? "Type = 'text/css 'rel = 'stylesheet'": "language = 'javascript 'Type = 'text/javascript '";
Var link = (isCSS? "Href": "src") + "= '" + $. includePath + name + "'";
If ($ (tag + "[" + link + "]"). length = 0) document. write ("<" + tag + attr + link + "> </" + tag + "> ");
}
}
});
$. Include (['script/jquery. divbox. js', '/css/pop_win.css']);
$ (Document). ready (function ()
{
Var IsFirstAlert = true;
Var alertQueue = [];
Window. alert = showAlert;
Var divalert = "";
Divalert + = "<div style = \" width: 380px; height: 180px; overflow: hidden; display: none \ "id = \" divAlert \ "> ";
Divalert + = "<div class = \" win_c \ "> ";
Divalert + = "<div class = \" win_t \ "id = \" \ "> ";
Divalert + = "<div class = \" mail_timg \ "> Divalert + = "<div class = \" clear \ "> <\/div> ";
Divalert + = "<\/div> ";
Divalert + = "<div class = \" alrt2 \ "style = \" text-align: center \ "> ";
Divalert + = "<span id = \" spaAlertMessage \ "class = \" f14 ifont \ "> <\/span> <br \/> ";
Divalert + = "<div class = \" clear \ "> <\/div> ";
Divalert + = "<\/div> ";
Divalert + = "<p class = \" Acenter \ "> <input id = 'alertclose' type = \" button \ "value = \" OK \ "class = \" btn7 \ "\/> <input type = \" reset \ "value = \" cancel \ "style = \" display: none \ "class = \" btn8 \ "\/> <br \/> <\/p> ";
Divalert + = "<p> <\/p> ";
Divalert + = "<\/div> ";
Divalert + = "";
Divalert + = "<\/div> ";
$ ("Body"). append (divalert );
Function showAlert (info)
{
AlertQueue. push (info );
If (IsFirstAlert)
{
IsFirstAlert = false;
OpenAlert ();
}
}
$ ("# AlertClose"). click (function ()
{
$ ('# DivAlert'). CloseDiv ()
If (alertQueue. length> 0)
{
SetTimeout (OpenAlert, 150 );
}
});
Function OpenAlert ()
{
$ ("# SpaAlertMessage" pai.html (alertQueue [0]);
AlertQueue. splice (0, 1 );
$ ("# DivAlert"). OpenDiv ();
}
});
Note: The jquery plug-in referenced above for js and CSS