jscript=function(){}
jscript.ui=function(){}
jscript.ui.alerts=function(){}
jscript.ui.alerts.showErrorAlert=function(){
alert('An error occurred');
}
jscript.ui.alerts.MessageDisplayer=function(inMsg){
this.msg=inMsg;
this.toString=function(){
return 'msg='+this.msg;
}
}
function test(){
jscript.ui.alerts.showErrorAlert();
var v =new jscript.ui.alerts.MessageDisplayer('Hello!!');
alert(v);
}
<input type='button' value='test Alert' onClick='test()'>