|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
back button not working
i have a very short html page. when the user clicks the submit button a javascript func is called that will cause a jump to a pdf document. this works, but when i click the back button on the browser, i cannot go back from the pdf. here is my code:
function getPDF() { url = "00A2001"; url = "http://intranet/legal/opinions/" + url + ".pdf"; document.write ("<meta http-equiv='refresh' content='1; url=" + url + "'>"); location.href = url <form method="POST" ><p> <b>Please enter your opinion number and press the submit button:</b><p> <input type="text" name="t1" size="8"></p> <p><input type="submit" value="Submit" name="B1" style="color: #0000FF" onClick="getPDF()"> <input type="reset" value="Reset" name="B2" style="color: #0000FF"></p> </form> |
|
#2
|
||||
|
||||
|
It's because you're using a meta refresh. When you click the button, you're overwriting the current document with the meta refresh, which redirects. When you hit the back button, I guess your browser has cached the rewritten version of the page, which just sends you right back to the PDF. Dump the document.write statement and, if need be, prepend "document." to the location.href=URL line.
|
|
#3
|
|||
|
|||
|
when i remove the document.write statement, i do not get to the url page, it just remains on the original page.
|
|
#4
|
||||
|
||||
|
Right, which is why you need to change
Quote:
to Quote:
as I indicated at the end of my post. |
|
#5
|
|||
|
|||
|
that works. thanks for all of your assistance...
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > back button not working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|