JavaScript Back Code that Always Works

While editing a Domino document on the Web, you may have used refresh-formulas or JavaScript-refresh a number of

times. The Domino server will, for each refresh, add a "Seq=x" to the url. This is, in itself, not a problem. The problem comes when users click your "Back"-button. If the code in your "Back"-button contains the standard window.history.go(-1), users will only back up to the state of the page previous to the last refresh, which is probably not what they want.

By using the code below, back will allways work.

 var curUrl = document.location.href; var ix = -1; var seqNum = 0; var seqPos = curUrl.indexOf("Seq="); if (seqPos != -1) { seqNum = curUrl.substring(seqPos+4, seqPos+7); ix = ix - seqNum; } window.history.go(ix);
This was first published in January 2001

Dig deeper on Domino Resources - Part 2

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close