Just to share the solution to an issue found during development. This one puzzled me for over three days.
Get the page into an iframe to go back. On the container this is no real problem, but once you have an iframe showing data from another site, then the security bells start ringing. Most of wrt apps will go to a remote server, and for this neither history.back() nor history.go(-1) will work. No even self.doc tree will be accessible.
On a .js just initiate the variable myreferrer as
On the link to go back -which must be able to use the same scope for myreferrer- do something like
Of course you can declare a function OneBack that would go something like