How to close a window using HTML

  • Author
  • #552546


    My sites are a mixture of blogging and pages: no problems with the former, and not many with the latter.
    I can open up a different page within my pages, and have this appear in a new window/tab (depending on browser) using basic HTML such as <!text to appear>.
    What I would like to be able to do as an act of courtesy for my few readers, is to provide them with the ability to close the window by clicking on some text. The standard HTML I have seen is:
    but this doesn’t appear to work.

    I am using Pilcrow as my theme. I have attempted to turn the code into comments: apologies if this hasn’t worked!



    The code should be:
    <a> href="http:/">text to appear</a>
    <a href="JavaScript:window.close()">Close</a>



    Javascript is stripped out here, for security reasons. You’ll have to find another way.



    Please see here for restricted codes >
    See this entry also so you are clear on the differences between free blogs from and being free hosted by wordpress.COM and wordpress.ORG installs for self hosting. >



    Thanks Guys: had wondered if that was the case, but have had to learn so many (specialist) programming languages over the years that Java and its possibilities including the risks is a gap in my knowledge.

    I have an alternative way of setting up my pages, just wondered if it could be done in HTML without Javascript.

The topic ‘How to close a window using HTML’ is closed to new replies.