Javascript Beep
August 4th, 2009 — 5:13am
This javascript method simply runs cmd by ActiveXObject to beep.
but it just works with internet explorer.
function myBeep() { try { var myObj = new ActiveXObject('WScript.Shell'); } catch (ex) { alert("sorry just working with IE..."); } //this will beep 2 times... myObj.Run("cmd /c @echo " + "".padRight(" ", 2).replace(/ /gi, String.fromCharCode(7)), 7); } String.prototype.padRight = function(C, L) { var A = new String(this); while (A.length < L) { A = A + C; } return A.toString(); };




