Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

forward request using Javascript

 
Bhushan Damle
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me what actually does?
I think it redirects the current window to the new location.
Is there any way in javascript that can forward the request instead of redirect?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. The request being a server-side entity, you won't access it from Javascript, so forwarding it is not possible either.
 
Bhushan Damle
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not a redirect either (which also makes sense only in the context of a server). Setting the href property replaces the current page with a different one, which leads to an HTTP request being sent to the server.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf's point is an important one. Many people talk about such changes in page location as "redirects" when, in fact, a redirect is a specific response received from the server that causes the browser to "redirect" to an alternate URL. Clicking a link or using JavaScript to change the page URL does not use the redirect mechanism.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic