| Author |
Ajax - I want to open a URL in the same window . how can i do that ?
|
Tiya Khambadkone
Ranch Hand
Joined: Sep 15, 2011
Posts: 40
|
|
I want to navigate to the url as I click on the 'Go' link on my existing page.
I am using jsp and ajax.
The code I have written is :
function launchURL(){
ajaxRequest.open("GET", "someContextRoot/hardcodedPath.do?customerName=" + custName + "&customerID=" + custID, false);
ajaxRequest.send(null);
}
<a href="#" onclick="launchURL();">Go</a>
The URL getting built is correct but I am not able to load the URL page on the same window.
How can I do that ?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56162
|
|
|
Don't use Ajax for that. The whole point of Ajax is to not replace the current page. If you want a "normal" submission that replaces the current page, use a "normal" hyperlink or form submission.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Ajax - I want to open a URL in the same window . how can i do that ?
|
|
|