![]() |
|
![]() | ||
|
Subject:
html/javascript submit and refresh
Category: Computers > Internet Asked by: vonwao-ga List Price: $8.00 |
Posted:
22 Nov 2004 20:14 PST
Expires: 22 Dec 2004 20:14 PST Question ID: 432667 |
I need to add a link to a page that will submit a request to a differnt URL, but after it's done it should refresh the current page (the page where the link was). I can control content of the respose, the only catch is that I have no way of knowing the URL of the original page. |
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: html/javascript submit and refresh
From: bpearson-ga on 11 Dec 2004 19:19 PST |
This will redirect to the second page with the current URL on the query string. The second page will then be able to get the original URL off of the query string and redirect back. Here is the code for the original page: <script type="text/javascript"> function Go( url ) { // Get the current url and escape it (URL encode) var currUrl = escape( window.location.href ); // Go to your new page window.location.href = url + '?returnAddress=' + currUrl; } </script> <a href="javascript:Go( 'http://someurl.com/secondpage.html' );">Click Me!</a> |
Subject:
Re: html/javascript submit and refresh
From: zzn-ga on 15 Dec 2004 18:57 PST |
it also can get the url of the request page in the pape where the link redirect to. For Example,In VBScript of ASP,the command is request.servervariables("http_referer"). |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |