|
JAVA SCRIPTS |
||||||||||||||
|
Welcome to SUPERLAND's Javascript Examples Page. Below are nine examples of common JavaScript.Of course there are other methods out there, this page is setup to help webmasters who have not had any or little experience with JavaScript. Use the menu below, or scroll down the page. Status Bar Text | Entrance Warning | Easy Navigation | Meta Refresh |
||||||||||||||
|
open("http://www.yourdomain.com/pagename.html","new_window","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,
width=800,height=600,top=0,left=0"); } //--> </SCRIPT> <!------ END CONSOLE CODE -------> Next, Copy and Paste this next line at the end of your <BODY> tag: onUnload="exitcnsl()" Example: You can experiment with the different settings, such as scrollbars=1,
location=1, menubar=1, resizable=1, height/width, etc. If you ONLY want the console to pop when the surfer leaves your
site and you have multiple pages, 1)Place your site within frames and use Target="_parent" on every link that leaves your site and needs to break the frames. 2)Place the console code in every page of your site, and add this to each <A HREF> statement that you do not wish the console to pop when clicked: onClick="exit=false" A correct link using the above code would look like this: This will allow your visitor to navigate between the pages of your site
without getting consoles every time would look like this: <A HREF="home.html" Target="_parent" onClick="exit=false"> As long as the surfer does NOT break the frames, the console will not
pop up. The console will only pop up |
||||||||||||||
| BLUR
ENTRY CONSOLE:
The "Blur" method will pop a console on the loading of a web
page instead of when the web page is unloaded or exited. Copy and Paste the following in the <HEAD> </HEAD> sections in your HTML document: NOTE: You will have to edit the domain and page to work with your web site. <SCRIPT language="JavaScript"> On the actual blur console, place this within the <HEAD> </HEAD> sections: <SCRIPT language=javascript> All Superland tours use the "Blur" method. Visit any one of our tours and view the source of "index.shtml"to see how easy this is to implement. TOP |
||||||||||||||
| MANUAL
POP UP WINDOWS:
To pop up a pre-sized window when clicking on a link, you can use this
code. A use for this would Here's an example: Copy and Paste the following within the <HEAD> </HEAD> sections in your HTML document: <SCRIPT language="JavaScript"> function popup(url){ //--> The link that calls the pop up window looks like this: The link inside of example.html that allows the user to close the popup
with the link looks like this: |
||||||||||||||
| WEB ABSTRACTION POP UNDER WINDOWS: | ||||||||||||||
|
</head> <body style="text-align: center"> |
||||||||||||||
| ONMOUSEOVER
STATUS TEXT:
To disguise or hide the true location of a link in the status bar, you can use simple Javascript to achieve this. The first link below is a normal link not using the "onmouseover" variable: CLICK HERE FOR PORNWhen the surfer mouse his mouse cursor over the link, he/she see's the true link in the browser's status bar. The next link uses the "onmousover" variable within the link code to hide the actuall link: Both the examples above have the same exact link, but the bottom example hides this. If you click and hold down the mouse button on the second link, you can see the true destination. Here's how it is done: 1)The link: 2)The "onmouseover" code: 3)The link and "onmouseover" code combined: |
||||||||||||||
| WEBTV
DETECTION SCRIPT:
If you're concerned with filtering WebTV traffic and want to be sure that your WebTV surfers are able to move through your site, you can redirect them to a "WebTV Friendly" version of your site. WebTV has allot of compatibility problems with Javascript. It does NOT work with the "onmouseover" variable and various other Javascript. If you have a WebTV surfer find your site and you have the "onmouseover" variable in your links, they will not be able to click on them. If you are concerned with this, put the following code at the entrance of your site (within the <HEAD> </HEAD> sections): <SCRIPT LANGUAGE="JavaScript"> If you have a large site, this could be time consuming to create two
complete versions, one for normal |
||||||||||||||
| STATUS
BAR TEXT
When your page loads, a good way to help people remember something is
to put a message in the ONLOAD="window.defaultStatus='PUT YOUR MESSAGE HERE'" And this tag within your body tag, should look like this: Click HERE for an example of what this looks like.NOTE:When combining several "ONLOAD" functions within the
same page, you can only use the command |
||||||||||||||
| ENTRANCE
WARNING
This short script allows you to ask the surfer a question. This example
is used to ask the surfer if he/she is Place this code within the <HEAD> </HEAD> sections of your HTML document: <SCRIPT LANGUAGE="JavaScript"> Here's an example of this code in use: |
||||||||||||||
| EASY
NAVIGATION
This example uses the backward and forward browser history. These are
easy "Back" and "Forward" buttons Here is an example:
NOTE: The forward button will not work unless there is a page in your browsers history to go "Forward" to. Here's the code: <FORM> It does not matter where you place the code in your document. Place the code wherever you would like the navigation buttons. TOP |
||||||||||||||
| META
REFRESH
Everyone has had the need at one point or another to have a page redirected to another location. The reasons for this are for different things. You could have moved a page to another server, you are using "Flash" and have a detection scheme to forward people that do not have the plugin installed, and many other reasons. Here is the code that is to be placed withing the <HEAD> </HEAD> tags at the beginning of your HTML document: <META HTTP-EQUIV="REFRESH" CONTENT="5; URL=javascript.html"> Click HERE for an example of how this works.
|
||||||||||||||
Status Bar Text | Entrance Warning | Easy Navigation | Meta Refresh |
||||||||||||||
|
||||||||||||||