473,804 Members | 3,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirection problem

Hi

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

strText += "<img style='cursor:h and' src='Resources/SurveyButtons/
Close.gif' onClick=javascr ipt:window.open ('ConfirmPage.a spx?
DisplayHeader=Y es&SurveyID=" + lngSurveyID + "','Results')>" ;
In the onclick event I want to close the current window then open
'ConfirmPage.as px'. 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

Oct 2 '07 #1
2 1432
Sems said the following on 10/2/2007 12:32 AM:
Hi

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

strText += "<img style='cursor:h and' src='Resources/SurveyButtons/
Close.gif' onClick=javascr ipt:window.open ('ConfirmPage.a spx?
DisplayHeader=Y es&SurveyID=" + lngSurveyID + "','Results')>" ;
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.
In the onclick event I want to close the current window then open
'ConfirmPage.as px'.
If you didn't open the current window with script, you aren't going to
close it with script.
Whats the best way to do this?
The "best way" would be to stop trying to open/close windows and your
life gets a lot simpler.
Can I close the first page then open the next, or should I be redirecting?
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.
If so whats the best way to redirect using javascript?
Best way to redirect a web page from one page to the next?

<a href="nextPage. html">Bet this works even with JS disabled</a>
Thanks
Sure thing.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 2 '07 #2
On Oct 2, 5:42 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
Sems said the following on 10/2/2007 12:32 AM:
Hi
I have a piece of javascript that is generated like so...
strText += "<img style='cursor:h and' src='Resources/SurveyButtons/
Close.gif' onClick=javascr ipt:window.open ('ConfirmPage.a spx?
DisplayHeader=Y es&SurveyID=" + lngSurveyID + "','Results')>" ;

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.
In the onclick event I want to close the current window then open
'ConfirmPage.as px'.

If you didn't open the current window with script, you aren't going to
close it with script.
Whats the best way to do this?

The "best way" would be to stop trying to open/close windows and your
life gets a lot simpler.
Can I close the first page then open the next, or should I be redirecting?

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.
If so whats the best way to redirect using javascript?

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

<a href="nextPage. html">Bet this works even with JS disabled</a>
Thanks

Sure thing.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptT oolbox.com/bestpractices
This is part of a legacy system so changing it away from using
javascript is not an option sadly.

Any other ideas?

Oct 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4705
by: Rick N. Backer | last post by:
Hello folks, Novice type question here. I'm working with a very simple app here that takes a series of strings from the console. Once the end user has finished inputting the strings they are individually processed and the result displayed back to the console. The problem I am having occurs during I/O redirection. Here is where
0
1483
by: Dimitrios Mpougas | last post by:
Hello, I have two asp.net pages. The first is a page (main.aspx) wich has four links on it. The href value of each link is: href="view.aspx?id=1" traget="_blank" href="view.aspx?id=2" traget="_blank" href="view.aspx?id=3" traget="_blank" href="view.aspx?id=4" traget="_blank"
13
2717
by: souissipro | last post by:
Hi, I have written a C program that does some of the functionalities mentionned in my previous topic posted some days ago. This shell should: 1- execute input commands from standard input, and also from a file conatining the commands 2- does the redirection of the input and output from and to files. 3- retrieve the environment variables like HOME,..
4
1829
by: psual | last post by:
hi newbie in web design I got some issue concerning a secure redirection between 2 pages let say I have a page with a grid (the 'master' page) in this grid I can select a record, get its pk then I redirect to another page (the 'detail' page) with the pk as parameter
13
4342
by: Massimo Fabbri | last post by:
Maybe it's a little OT, but I'll give it try anyway.... I was asked to maintain and further develop an already existing small company's web site. I know the golden rule of "eternal" URIs, but in this case changing them cannot be avoided as they were badly chosen when thwe site was first delevoped: URLs with spaces, typos, etc. So I have to use new URLs and put the content in them.
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10569
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10325
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.