An alternative to alert function in javascript core