有一個應用,要求一個下拉式清單(class1)的變化觸發另一個依賴列表(class2)的變化。參照《下拉框連動(資料庫版)》,有以下程式片段:<% sql = "select id, name, substring(id,1,2) bigclass from classone where type='1' order by id" set rs =
代碼如下複製代碼 <div class="demo-container"> <SCRIPT language=javascript><!--function showtime(){ var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var
技巧一之setTimeout.應用案例:比如你想一個函數迴圈執行10次,怎麼辦?以前通常是先setInterval,然後clearInterval,技巧一就是克服這個問題 代碼如下複製代碼 (function () { var i = 0; function job() { console.log(i++); &
代碼如下複製代碼 /***把字串轉換為日期對象*參數:日期文字例如:2011-04-19或者19/04/2011*返回:日期對象Date*註:IE下不支援直接執行個體化日期對象,如new Date("2011-04-06")**/Date.prototype.converDate=function(date){ var flag=true; var
<!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
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.111cn.net/ 1999/xhtml"><head><meta