JS code not working

I have a thank you page that opens up when a new document is created. It launches OK but kicks the user back to a page that displays the following comment:Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh button.

This should bring the user back to the page before starting to create a new document. Instead, the URL does not even go to that page.

When I do refresh the error message page it takes the user to the document when it was in creation mode which is only one page back. I tried different values in the history.back() code line but no difference. Is there a way to have code that sends the user to a specific view name?

Here is what I have in the JS events of the thank you page:

onLoad event code:

autoClose()

JSHeader event code:

function closeWindow() {

history.back(-2)

}

Can someone tell me where correction are required to fix this?

Thanks,

Dan

Subject: JS code not working

Dan,

You can just send the user to the URL you want by assigning a value to the location property of the window via JavaScript. It might look something like…

location = “/path-to-DB/database.nsf/myView?OpenView”

…optionally, you could pass some parameters…

location = “/path-to-DB/database.nsf/myView?OpenView&name=Bob&code=123&”

Ken

Subject: history.go(-2)

I don’t believe that the back method takes navigation arguments – of course, I could be wrong, since netscape has decided to take down its reference site, there’s no way I know of to check online anymore.

Subject: My $$Return field

Here’s the formula I use in my computed-for-display $$Return field:

tR:=@Random;

"<script language="Javascript">

var pathname = window.location.pathname.toLowerCase().split (".nsf");

alert (‘Document saved.’);

window.location=pathname[0]+".nsf/myview?openview&r=“+@Text(tR)+”"

"

(Adding the random number at the end of the URL forces the view to reload.)