| You are here : Web design > JavaScript > Document | DinkostaOnline |
|
| The document object is on top of the DOM hierarchy, just below the window object. Because of this, the document object is the starting point for most JavaScript objects. Here are some example scripts : Add to Favorites (IE): If you have a web site and want to make it easy for your visitors to add your site to the favorites, here is a script for that purpose (put it in the <head> section): |
|
No right-click: Web site owners often would like to protect their images or other content, but can't do it effectivelly. The following script can provide protection only against people who are not very familiar with their browser, but at least it's some kind of content-protection and it's very simple. The script that disables the right-click on a page goes like this (put in <head> section) : Blocking JavaScript errors: On a page with external content (automated news, ad banners etc) you can often notice in the status bar a notification about a JavaScript error. The next script can help prevent the display of such an error notification: Display and hide content: The next script demonstrates how to display or hide content on a page:
Show example
Next: The window |