hn4u @ Last updated 21/11/04 22:42
Go to my homepage at http://4u.jcisio.com
Full version available at http://4u.jcisio.com/r/article642.htm

Không rõ

Hỏi tên web surfer

Bạn có thể tùy vào tên nhập vào mà có hành động khác nhau, như đoạn script sau:

Mã lệnh (JS)
surfer=prompt("Hi, what's your name?","Anonymous Websurfer");
if (surfer==""||surfer==null){surfer="noname"}
if (surfer=="filezguy"){document.write("Here are my filez! <link> <link> etc, you get the idea...")}
else {document.write("Welcome to my page, "+surfer+"! Good luck");}


hainam4u @ Last updated 21/11/04 22:42
Go to my homepage at http://4u.jcisio.com