simplify
add getOnUnloadWarningMessage method to avoid js exception on page
unload event