Probably the best e-Portfolio in the world...
 
PICTURE SCROLL BOX
The Beatles Bus The Yellow Submarine Liverpool FC in the Simpsons
 
CHAT BOX

 
COMPLETE DATABASE

graphic designs

mathematics

written essays

Home  >>  My Work  > Coding

Introduction


All the scripts here have been incorporated from different sources and changed by me. Each set of codes offer unique attribute/effects as they may come in handy for everyone.

>>> Javascript

>>> PHP

>>> VB

>>> Actionscript 2.0

 

Javascript


The javascript below will make a link show a popup before directing you to another page:

JAVASCRIPT FILE: alert.js

window.onload = initAll;

function initAll() {
document.getElementById("redirect").onclick = clickHandler;
}

function clickHandler() {
alert("You are now being redirected to the front page!");
return true;
}

HTML FILE:

<script type="text/javascript" src="alert.js"></script>

<div style="text-align: center;">

<a href="http://www.andrewchau.co.cc" id="redirect">CLICK TO TEST</a>

CLICK TO TEST

 

The javascript below will prevent webpage viewers from right clicking or highlighting any page content:

EMBEDDED INTO THE HEAD TAG:

<script language="JavaScript1.2">

function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>


<script language=JavaScript>
<!--

var message="";
//
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.onclick=reEnable
document.oncontextmenu=new Function("return false")
// -->
</script>

 

 

PHP


The PHP code below will redirect your page to another designated one (etc.google):

PHP FILE: redirect.php

<?php
header("Location:http://google.com");
?>

CLICK TO OPEN redirect.php

 

 

Visual Basic


Visual Basic code to generate a lucky number 7 draw:

Coming soon...

DOWNLOAD HERE

 

 

Flash Actionscript 2.0


Coming soon:

Coming soon...

 
 
home | about me | communities | my work | interaction | forums | links | contact me
Copyright © 2006-2009 Andrew Chau's e-Portfolio. All rights reserved.