Redirection problem

S

Sems

Hi

I have a piece of javascript that is generated like so...

strText += "<img style='cursor:hand' src='Resources/SurveyButtons/
Close.gif' onClick=javascript:window.open('ConfirmPage.aspx?
DisplayHeader=Yes&SurveyID=" + lngSurveyID + "','Results')>";


In the onclick event I want to close the current window then open
'ConfirmPage.aspx'. Whats the best way to do this? Can I close the
first
page then open the next, or should I be redirecting? If so whats the
best way to redirect using javascript?

Thanks
 
S

Sems

Sems said the following on 10/2/2007 12:32 AM:




You can ditch the voodoo practice of javascript: in onclick event
handlers. It serves no purpose on the web. Second, give up opening new
windows, it is going to fail about as often as it succeeds. I know, your
boss wants it. Educate the "boss" and use a link to the page instead.


If you didn't open the current window with script, you aren't going to
close it with script.


The "best way" would be to stop trying to open/close windows and your
life gets a lot simpler.


As you can't close the first page, anything you do is better than trying
to. Just make it a link, let the user click it, open the next page in
the current window, and enjoy having a happy customer.


Best way to redirect a web page from one page to the next?



Sure thing.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices

This is part of a legacy system so changing it away from using
javascript is not an option sadly.

Any other ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,155
Messages
2,570,871
Members
47,401
Latest member
CliffGrime

Latest Threads

Top