I always thought it was
api.closeWin({
name: api.winName
})
However this is to close the page
The following is to return to the previous level
tlml
<div id='back'></div>
js
api.historyBack({
},function(ret,err){
if (!ret.status) {
api.closeWin();
}
});