pulpfiction Posted March 16, 2007 Share Posted March 16, 2007 Is there a way to close popup from alert() statement??something like Self-closing Alert Window.... Pop-up window which user do not need to close. Link to comment Share on other sites More sharing options...
aspnetguy Posted March 16, 2007 Share Posted March 16, 2007 I don't know of anyway to do that other than simulating an alert box with your own custom code. Link to comment Share on other sites More sharing options...
PrateekSaxena Posted March 16, 2007 Share Posted March 16, 2007 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 More sharing options...
pulpfiction Posted March 16, 2007 Author Share Posted March 16, 2007 I don't really understand what you are sayingIs there a code to automatically close the popup window that comes up on alert() command... Link to comment Share on other sites More sharing options...
jesh Posted March 16, 2007 Share Posted March 16, 2007 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 More sharing options...
jesh Posted March 16, 2007 Share Posted March 16, 2007 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 More sharing options...
pulpfiction Posted March 16, 2007 Author Share Posted March 16, 2007 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 More sharing options...
jesh Posted March 16, 2007 Share Posted March 16, 2007 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.htmQuick 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 More sharing options...
pulpfiction Posted March 16, 2007 Author Share Posted March 16, 2007 Guess function alert() {} will work best, it just prevents the popup, i didnt understand why be better, then I have to create a div element.... function alert(string){ document.getElementById("display").innerHMTL += string + "<br />";} Link to comment Share on other sites More sharing options...
jesh Posted March 16, 2007 Share Posted March 16, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now