Saturday, January 14, 2012

SCRIPT REDIRECT

Cara Redirect Situs dengan Javascript - Thread Not Solved Yet
Dengan Java script kamu juga bisa membuat halaman yang otomatis redirect ke halaman tertentu. Berikut contohnya

Tanpa jeda waktu

PHP Code:
<html>
<
head>
<
title>Youll be redirected</title>
<
script type="text/javascript">
<!

window
.location "http://www.domaintujuan.com" //�> </script>
<body>
If your browser doesn�t automatically redirect,
please <a href="http://www.domaintujuan.com">click here.</a>
</body>
</html> 
Dengan jeda waktu

PHP Code:
<html>
<
head>
<
title>You'll be redirected after 2 seconds</title>
<script type="text/javascript">
<!�
window.setTimeout('
window.location="http://www.domaintujuan.com"',2000);
//�>
</script>

<body>
If your browser doesn'
t automatically redirect, please <a href="http://www.domaintujuan.com">click here.</a>
</
body>
</
html
Angka 2000 diartikan milisecond atau dapat diartikan 2 detik. Jika ingin men-set 10 tinggal menggantinya menjadi 10000.

No comments:

Post a Comment