When you close a document with codes like above, the java script command
"window.open(location)" will be executed. This is why you got trapped and can't get out of it!! The only chance is....
The HTML document in the Hotel California link above has used some java scripts too:
<A href="realtrap.html"
target="_blank"
title="Don't click here!! You will be trapped!!!"
onMouseOver=
"document.enter.src='Eagles-h2.gif';
document.warning.src='warning.jpg';"
onMouseOut=
"document.enter.src='hotel.gif';
document.warning.src='Checkin.jpg';">
In HTML document, we can insert some Java Script codes by use the <script> tag. Consider the following code:
<h3>The properties of the current document:</h3>
<SCRIPT language="javascript">
document.write("The background color is "
+ document.bgColor + ".<br>");
document.write("The foreground color is <strong>"
+ document.fgColor + "</strong>.<br>");
document.write("The link color is <font color='green'><b>"
+ document.linkColor + "</b></font>.<br>");
document.write("The URL is <font color='black'><b>"
+ document.location + "</b></font>.<br>");
document.write("The title of this page is <font color='red'><b>"
+ document.title + "</b></font>.<br>");
document.write("The document was last modified:
<font color='blue'><B>" +
document.lastModified + "</b></font>.")
</SCRIPT>
The code above will generate the following text in the current browser.
The properties of the current document:
The values of properties of navigator, history, and location
<SCRIPT language="javascript">
document.write("The browser is <font color='blue'><B>"
+navigator.appName+ "</font>.</B>")
document.write("<br> Its version is <font color='blue'><B>"
+navigator.appVersion+ "</font>.</B>")
document.write("<br>You have visited <font color='blue'><B>"
+history.length+ "</font></b> pages.")
document.write("<br>The name of this location is <font color='blue'><B>"
+location.host + "</font></B>." )
document.write("<br>The host name of this location is <font color='blue'><B>"
+ location.hostname + "</font></B>." )
</SCRIPT>
generate:
We can assign a value to those property variable to change the properties of the current document.