- สร้างหน้าเวบให้ redirect อัตโนมัติ
<html>
<head>
<script>
function redir() {
var url="firsturl";
if (condition = true) url="secondurl";
setTimeout("document.location='"+url+"'",
30000);
}
</script>
</head>
<body onload="javascript:redir();">
<input type="hidden" id="hid" value="htmlfile">
</body>
</html>
<html>
<head>
<script type='javascript'>
function redir(redirurl){
window.location = 'redirurl';
}
</script>
</head>
<body>
<a herf='#' onclick="javascript:redir('http://www.yoururl.com')">Click here</a>
</body>
</html>
Or you can onload like this
<html>
<head>
<script type='javascript'>
function redir(redirurl){
window.location = 'redirurl';
}
</script>
</head>
<body onload="redir('http://www.yoururl.com')">
</body>
</html>
- สร้าง drop down list ให้ลิ้ง ไปเวบอื่น
หรือหน้าอื่น
<select name=city
onchange="location=this.value;">
<option value="">Select your
Country
<option
value='index.html'>page1
<option value="http://www.google.de/">Germany
<option value="http://www.google.gr/">Greece
</select>