TheFreePage1.tripod.com

Or

Mirror Sites

Join The Mailing List
hostsave
TELL A FRIEND ABOUT THEFREEPAGE
CD-WOW CD's ONLY £8.99!!!
CD-WOW CD's ONLY £8.99!!!

Java

Below are lots of java script codes that you can use free to enhance your website and make it easier to use.

Linkshare
Ultimate Traffic System
Ultimate Traffic System

Copyright | Contact Us | Help | FAQ | Gif Images | Links | Search | Web Polls | About Us | Downloads | Java | Mirror Sites

<SCRIPT LANGUAGE="JavaScript1.1"  type="text/javascript">
<!--
<!-- Prevent Right Mouse Click
function right(e) {
  if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
    return false;
  else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
    alert("Sorry, you do not have permission to right click.");
    return false;
  }
  return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
//  End -->

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>

Prevent Right Click

Instructions: Simply insert the script below into your website to prevent users from right clicking on your web page and copying information from it. You can also customize the message that pops up when a user right clicks by changing the "Sorry, you do not have permission to right click. Bit of the code."

To see an example the java code click HERE.

Date Modified

To tell users when your web page was last modified this nice piece of code does this automatically for you. Simply copy and paste the code below into your web page.

There are three examples of it below.

The three examples can be achieved by modifying the line "var p = m.length-8". To achieve no.1. Leave the line as it is. To achieve no.2. Change the '8' to a '3' and to achieve no.3. Change the 8 to a '0'. Obviously do not put in the '' or it wont work!!!

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var m = "Page updated " + document.lastModified;

var p = m.length-8;

document.writeln("<center>");

document.write(m.substring(p, 0));

document.writeln("</center>");

// End -->

</SCRIPT>


<!-- Script Size:  0.65 KB  -->

No.1.


No.2.


No.3

Search Engine

Add a search engine to your site that will actually search your website.

Instructions: Add the code below to your website, where the search box appears depends on where you put it in your source code. Read what the code says and you will learn how to modify the code so that it searches your website

Example of the search engine.

Type in 'free' then press 'search'


<!-- TWO STEPS TO INSTALL SITE SEARCH:


  1.  Copy the coding into the HEAD of your HTML document

  2.  Add the last code into the BODY of your HTML document  -->


<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->


<HEAD>


<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var item = new Array();


/* Here is where all the magic happens. 

    Just enter as many additional pages that

    that you want to search, then fill in the

    additional listings for each page.

*/


// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"


c=0; item[c]=new Array("index.html","","Page Title","key words,separated by a comma,","Description of page.");

c++; item[c]=new Array("index.html","","Page Title","key words,separated by a comma,","Description of page.");

c++; item[c]=new Array("index.html","","Page Title","key words,separated by a comma,","Description of page.");

c++; item[c]=new Array("index.html","","Page Title","key words,separated by a comma,","Description of page.");

c++; item[c]=new Array("index.html","","Page Title","key words,separated by a comma,","Description of page.");

c++; item[c]=new Array("index.html","","Page Title","key words,separated by a comma,","Description of page.");



page="<html><head><title>Search Results</title></head><body bgcolor='white'><center><table border=0 cellspacing=10 width=80%>";



function search(frm) {

win = window.open("","","");

win.document.write(page);

txt = frm.srchval.value.split(" ");

fnd = new Array(); total=0;

for (i = 0; i < item.length; i++) {

fnd[i] = 0; order = new Array(0, 4, 2, 3);

for (j = 0; j < order.length; j++)

for (k = 0; k < txt.length; k++)

if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")

fnd[i] += (j+1);

}

for (i = 0; i < fnd.length; i++) {

n = 0; w = -1;

for (j = 0;j < fnd.length; j++)

if (fnd[j] > n) { n = fnd[j]; w = j; };

if (w > -1) total += show(w, win, n);

fnd[w] = 0;

}

win.document.write("</table><br>Total found: "+total+"<br></body></html>");

win.document.close();

}

function show(which,wind,num) {

link = item[which][1] + item[which][0];

line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> Score: "+num+"<br>";

line += item[which][4] + "<br>"+link+"</td></tr>";

wind.document.write(line);

return 1;

}

//  End -->

</script>

</HEAD>


<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->


<BODY>


<center>


<form method=get action="javascript:void(0)" onsubmit="search(this); return false;">

<tr><td><input type=text name=srchval value=""><input type=submit value="Search"></td></tr>

</form>


</center>


<p><center>

<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>

by <a href="https://thefreepage1.tripod.com/java">TheFreePage</a></font>

</center><p>


<!-- Script Size:  3.16 KB -->

Back

Back Button/Link

This code lets the user to click on the back button or link and they will go back to the previous page they were on. It can also be modified so that it goes back any number of pages.

There are two different versions of this code. One shows a normal text link back and the is a button that sends the user back when they press it.

Follow the instructions in the code on what to do.

Examples of both of them are shown below/

Text Link


<!-- ONE STEP TO INSTALL BACK BUTTON:


  1.  Copy the coding into the BODY of your HTML document  -->


<!-- STEP ONE: Paste this code into the BODY of your HTML document  -->


<BODY>


<!-- This script and many more are available free online at -->

<!-- TheFreePage! https://thefreepage1.tripod.com/java -->


<a href="#" onClick="history.go(-1)">Back</a>


<!-- Change the value of -1 to any number of pages you would like to send your visitors back -->


<!-- Script Size:  0.60 KB -->

Button


<!-- ONE STEP TO INSTALL BACK BUTTON:


  1.  Copy the coding into the BODY of your HTML document  -->


<!-- STEP ONE: Paste this code into the BODY of your HTML document  -->


<BODY>


<!-- This script and many more are available free online at -->

<!-- TheFreePage https://thefreepage1.tripod.com/java -->


<input type=button value="Back" onClick="history.go(-1)">


<!-- Change the value of -1 to any number of pages you would like to send your visitors back -->


<!-- Script Size:  0.60 KB -->