Just like any other element. Although when not within a form it might be more semantic to use other elements for CTAs… in this case, “return to previous page” would be a good candidate for an <a> tag with a fallback href, for instance.
What I am trying to do is to open a new page with target=“_blank” which will not have any navigation, and obviously will not have a back button active. The only way to carry on is to close the page and be back on the original one.
The visitor has only one option: leave by clicking on the red X in the top corner (or pressing ALT F4).
I would like to place a large button, (with an explanation below: “Press to return to the previous page”) that did exactly the same.
Imagine 2 webpages, each for one country. each has subsidiary pages for all sorts of things, including for instance a page on electrical current in that country.
Now imagine that another country comes along but this one has two cities. esch with its own page, say, London and Oxford. The electrical current is the same so there are going to be two indentical pages with different urls. Google does not like that.
I have worked out two ways of getting round the problem but am still looking for something more elegant.
The idea is that each city will link to the same page, but needs to return to the page where it was before. One solution was to give a choice of the towns: “Return to London” and “Return to Oxford” without using target blank… The other using target blank, simply asks the visitor to close the page via the x in the tab.
so would something like i have on this page do what you need http://www.goodbeachguide.co.uk/beach/wembury#waterquality
if you click on the ‘designated bathing waters’ link in the first para it should open a ‘lightbox’ with info about water quality. This is the same information across many of my beach pages. I could pull in other information if i wanted simply using a dynamic page and a url query string or just link to individual static pages.
So for example you’d set up a page about electrical current for the uk and you’d just make a link to the lightbox to open it from the london page and the oxford page. If you did it dynamically like above you could stick all this info in a database and have an output page to link to and have the url determine which one to return e.g infopage.php?country=england&type=electric
Yes, the idea of a popup, My site started with that sort of thing but I had to give it up because Edge could not cope with it.
No, if I am unable to presetn the page with its sidebar and all.
I had thought of simply opening the page in a slightly reduced format so that the visitor could always see the main page below. the, it would be intuitive to close the smaller one to carry on with the main one.
I would still say that the right thing to do, and the easy thing to do, in this case coincide. Don’t open it in a new tab/window. Open the link the way links were designed to be opened, in the same tab/window. (The user can always choose to open in a new tab, but you shouldn’t take that control away from them. It causes accessibility/usability issues.)
I tried this but obviously I did not understand it. When I click I end up back on the page I want to close
border:solid gray 5px;
padding:30px 0 20px 0;
<a href="#" onclick="closeWin()"><p> To return to the previous page <br><b>close this tab only</b><br>Press the little x at the top in the tab<br> not in the top right corner.</p>