?
Solved

Redirect to a new page and go to home page on the original page at the same time.

Posted on 2015-01-30
6
Medium Priority
?
70 Views
Last Modified: 2016-04-23
I have a transaction page which has a button to show receipt page. I need to show it in a new window. I am able to do it using target="_blank" in the redirect. However, I want to also go to home page from the original transaction page at the same time. I don't know how to do that. Any hints or help is very much appreciated. I prefer a classic ASP server side solution, However, I am open to HTML or javascript solution also if those exist.

Thanks
spraocs
0
Comment
Question by:spraocs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 10

Accepted Solution

by:
Jeffrey Dake earned 2000 total points
ID: 40581128
I think attaching some JavaScript that replaced the onclick event might work, using window.open

http://www.w3schools.com/jsref/met_win_open.asp

Something like the following on the onclick event.

Window.open('recept page);
Window.open('home page', '_self');
Return false;
0
 
LVL 4

Expert Comment

by:Monika Bharti
ID: 40581159
Here is the code written using javascript, to redirect to a new page and go to home page.

$('#someButton').click(function() {
    window.location.href = '/some/new/page';
    return false;
});

Open in new window


OR you can use the id to take the user to home page and at  the same time the target blank will cause the url that you wanted to be opened in new tab.
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 40581658
another option is to go back to the home page first, then do a window.open(popUpPage.asp) on page load. if you need to open the pop up with some kind of dynamic data, save all of that data in a session variable (or cookie), then you can access it on the home page
0
 
LVL 16

Expert Comment

by:Kiran Paul VJ
ID: 40582916
Hi spraocs,

You solution with "target="_blank" will work for showing the receipt in a new window. But since you need to redirect the existing page to home page you need to have a JavaScript solution also.

Try this

<a href="receipt-page.html" target='_blank' onclick='window.location.href="homepage.html"'>Show receipt</a>

Open in new window


A sample html file attached. Change urls to your file names.

hope this helps,
kiranvj
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question