分类:
2006-04-10 00:16:16
- <script language=”JavaScript”>
- var
myURL = document.URL;
window.alert(myURL);
- <script language=”JavaScript”>
document.write(“<p>Here’s some information about this document:p>”);
document.write(“<ul>”);
document.write(“<li>Referring Document: “ + document.referrer + “li>”);
document.write(“<li>Domain: “ + document.domain + “li>”);
document.write(“<li>URL: “ + document.URL + “li>”);
document.write(“ul>”);
- document.writeln(“<strong>astrong>”);
document.writeln(“b”);
- <script language=”JavaScript”>
- var
thisDate = new Date();
document.write(thisDate.toString());
- <script language=”JavaScript”>
- var
myOffset = -2;
- var
currentDate = new Date();
- var
userOffset = currentDate.getTimezoneOffset()/60;
- var
timeZoneDifference = userOffset - myOffset;
currentDate.setHours(currentDate.getHours() + timeZoneDifference);
document.write(“The time and date in Central Europe is: “ + currentDate.toLocaleString());
- <script language=”JavaScript”>
- var
thisDate = new Date();
- var
thisTimeString = thisDate.getHours() + “:” + thisDate.getMinutes();
- var
thisDateString = thisDate.getFullYear() + “/” + thisDate.getMonth() + “/” + thisDate.getDate();
document.write(thisTimeString + “ on “ + thisDateString);
- <script language=”JavaScript”>
- var
urlParts = document.URL.split(“?”);
- var
parameterParts = urlParts[1].split(“&”);
- for (
i = 0; i < parameterParts.length; i++) {
- var
pairParts = parameterParts[i].split(“=”);
- var
pairName = pairParts[0];
- var
pairValue = pairParts[1];
document.write(pairName + “ :“ +pairValue );
- }
- <script language=”JavaScript”>
- function
newDocument() {
document.open();
document.write(“<p>This is a New Document.p>”);
document.close();
- }
- <script language=”JavaScript”>
window.location = “http://”;
- <html>
- <
head>
- <
script language='javaScript'>
- var
placeHolder = window.open('holder.html','placeholder','width=200,height=200');
The Main Page
This is the main page
-