This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Ajax - I want to open a URL in the same window . how can i do that ?  RSS feed

 
Tiya Khambadkone
Ranch Hand
Posts: 114
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!