: DinkostaOnline - Scripts 1 :
 You are here : Web design > JavaScript > Miscellaneous scripts > Part oneDinkostaOnline 
Top links

HTML intro

CSS intro

Batch files

Introduction to JavaScript

Webmasterstuff

How to search the Internet

The Registry

Security on the Internet

About Pirot
Miscellanous scripts - part 1
  Scripts that didn't fit into the other categories, I've decided to label Miscellenous scripts. On this page is the first part of these scripts.
Date and time in titlebar: If you click here, in the titlebar should appear the current date and time (in the 24 hour format). After you click here, the time and date should disappear from the titlebar.
 Put the href attribute in the <body> section, like <a href="#" onclick="sat2()">Show time</a> to show the time and date in the titlebar, and the following link <a href="#" onclick="location.reload()">No clock in titlebar</a> to make it go away. You can make the time and date appear in the titlebar when the browser window opens, if you put the function in the onload= event: <body onload="sat2()">.
Add the following code into the <head> of your document:
Dynamic content: To create content that automatically changes every day or every month, you need first to create external .js files with the content for every day. These .js files don't have <script>...</script> tags, they start with document.write (', then comes the content and it all ends with '). Example:
document.write('<h2 align=center style="color:maroon">Add Notepad to the context menu (Win 9x/Me)</h2>To add Notepad to the context menu, open the registry and find <small>HKEY_CLASSES_ROOT\\*</small>.<BR>Now you\'ll need to...etc');
The content inside the brackets can't contain more than one space, otherwise it wont work. Since the content is within single quotes, you'll need to precede every single quote or apostrophe in the content with a backslash: \' and you'll need to do the same with backslashes that occur in the content:\\.
After the file is finished, name it 'mon.js' or whatever, but the .js extension is important. Create in the same way files for all the other days and name them. To put these files in your HTML page, place where you want the content to appear the following:
Pay attention to the alternating quotes and keep in mind that the content inside the brackets must not contain more than one space (don't use the 'Enter' key). To implement a monthly content change, use getMonth() instead of getDay() and add five more files.

 Next 

1
Hosted by www.Geocities.ws