Jump to content

Close alert


pulpfiction

Recommended Posts

I don't really understand what you are saying but do you mean something like this http://w3schools.invisionzone.com/index.ph...ost&p=52941

Link to comment
Share on other sites

Hmm...execution of the javascript pauses on alert. Could you do something like this?

...alert("An error has occurred, this window will close...");window.close();

Or, if you are trying to close a child window whose reference is held in a variable called "wnd", it'd be something like this:

...alert("An error has occurred, the child window will close...");wnd.close();

Link to comment
Share on other sites

Is there a code to automatically close the popup window that comes up on alert() command...
Oh, close the alert window? No, I don't believe that there is.
Link to comment
Share on other sites

Reason why I wanted to know that is cos, my friend has this login system which when the user registers in the website, it takes only login name and gives him 4-digit [numeric] as password, so i thought it would be easy to hack [just to prove its a bad idea]. If I know the login name then all I need is to use JS and fill the username textbox with that and loop through all 4 digit numbers and one of them will login. but the only problem is that every time when the login is incorrect it popups a message, if I could close it then loop will continue.... :)

Link to comment
Share on other sites

Reason why I wanted to know that is cos, my friend has this login system which when the user registers in the website, it takes only login name and gives him 4-digit [numeric] as password, so i thought it would be easy to hack [just to prove its a bad idea]. If I know the login name then all I need is to use JS and fill the username textbox with that and loop through all 4 digit numbers and one of them will login. but the only problem is that every time when the login is incorrect it popups a message, if I could close it then loop will continue.... :)
ROFL, check this:http://www.webmasterworld.com/forum91/1274.htm
Quick and dirty, but it works (tested in IE6):function alert() {}
I just tested in Firefox and it works too...EDIT: This may be even better:
function alert(string){	document.getElementById("display").innerHMTL += string + "<br />";}

Link to comment
Share on other sites

I only thought it'd be better because you'd still be able to see what the alerts where supposed to be alerting. If you are OK with completely ignoring the messages until you are logged in, then function alert() {} would probably be the best way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...