lenerd3000 Posted February 28, 2008 Share Posted February 28, 2008 i have a question about this function of javascript. if (schedules.closed) { do something } else if (!schedules.closed) { do something } the first function does not working. i dont know why but the latter does what i want. what is the problem their. Quote Link to comment Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 What do you mean "not working"? What are you trying to do? What is supposed to happen? What is actually happening? Quote Link to comment Share on other sites More sharing options...
lenerd3000 Posted February 28, 2008 Author Share Posted February 28, 2008 function close() { if (schedules.closed) { //redirect page } else if (!schedules.closed) { shedules.close() //redirect page } } after i click my button it will call that function that determine if my popup window is open or not and then redirect. my problem is if my window is close, suppose to be it will only redirect but its not... and if my window if open it will close the window then redirect... Quote Link to comment Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 Where is your redirect code? Quote Link to comment Share on other sites More sharing options...
lenerd3000 Posted February 28, 2008 Author Share Posted February 28, 2008 function close() { if (schedules.closed) { location.href='index.php' } else if (!schedules.closed) { schedules.close() location.href='index.php' } } my redirection is ok and also the function if schedules.closed will be remove. schedules.close() is working. only the schedules.closed is my problem... tnx for the reply Quote Link to comment Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 try: window.location="index.php" and if that doesnt work, try: this.location="index.php" I think the first one should work though. EDIT: I made a mistake in my sytnax. Just fixed it now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.