E-3、進階應用-語法javascript
Java Script 嵌入應用
彈跳選單
<script type="text/javascript"><!--
function surfto() {
var myindex=document.getElementById("yudan35").selectedIndex;
window.open(document.getElementById("yudan35").options[myindex].value,"_blank","");}
// --></script>
<select id="yudan35" size="1">
<option selected="selected" value="">請 選 擇 目 的 地</option>
<option value="http://www.google.com.tw/">google</option>
<option value="http://www.yahoo.com.tw">yahoo</option>
<option value="http://www.bmps.hc.edu.tw">北門國小</option>
</select>
<input type="button" value="出發" onclick="surfto()" />
現在時間
<script type="text/javascript"><!--
var yudan = "";
var now = new Date();
var month = now.getMonth() + 1;
var date = now.getDate();
var year = now.getYear();
if (year < 2000) year = year + 1900;
if (month >= 3 && month <= 4) yudan = "春季 ";
if (month >= 5 && month <= 8) yudan = "夏季 ";
if (month >= 9 && month <= 10) yudan = "秋季 ";
if (month >= 11 || month <= 2) yudan = "冬季 ";
document.write(year + " 年 " + yudan + month + " 月 " + date + " 日 ");
// --></script>
java script 參考網站
不重複計數 UniqueVisitors
瀏覽頁次計數 PageViews