1. bikin 3 file text dengan nama text1.txt, text2.txt, text3.txt
2. file html yang isinya
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function loadurl(dest) {
try {
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
}
xmlhttp.onreadystatechange = triggered;
xmlhttp.open("GET", dest);
xmlhttp.send(null);
}
function triggered() {
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
document.getElementById("output").innerHTML = xmlhttp.responseText;
}
}
</script>
</head>
<body>
<form>
<select name="select" id="select" onchange="loadurl(this.value)">
<option value="text1.txt">text1</option>
<option value="text2.txt">text2</option>
<option value="text3.txt">text3</option>
</select>
<textarea id="output"></textarea>
</form>
</body>
</html>
code diatas bisa jalan di firefox 3 di coba di opera 6.1 gak sempurna....
coba ja di explore lagi... wkwkwkwkwkw
Tidak ada komentar:
Posting Komentar