亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1885 | 回復(fù): 2
打印 上一主題 下一主題

onlick if else 的問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2011-12-24 01:08 |只看該作者 |倒序瀏覽
  1. <script type="text/Javascript">
  2. function update_change()
  3. {
  4.          update=document.getElementById('update').value;
  5.          week_date = new Date();
  6.         day = week_date.getDay();
  7.         if (day == "0")
  8.         {
  9.                 day = 7 ;
  10.         }
  11.         month_day = week_date.getDate();
  12.         // now_str = week_date.getFullYear()+"-"+ (week_date.getMonth()+1)+"-"+week_date.getDate();
  13.         differ = 7 - day + 1;
  14.         
  15.          endtime = new Date();

  16.         arr = update.split("-");
  17.         update_format = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],'0','0','0'));
  18.         now_format = new Date(Date.UTC(week_date.getFullYear(),(week_date.getMonth()),week_date.getDate(),'0','0','0'));
  19.         
  20.         update_format = (update_format.getTime()/1000);
  21.         endtime_format = (now_format.getTime()/1000+differ*24*60*60);
  22.         //alert(endtime_format);
  23.         //alert("end "+endtime_format+" upd "+update_format);
  24.         if (update_format >= endtime_format)
  25.         {      
  26.                 plan = "是";
  27.                  sl_plan_obj = document.getElementById('select_isplan');
  28.                 sl_plan_obj.options.length=0;
  29.                 sl_plan_obj.options.add(new Option(plan,"value"));
  30.                                 alert("是")
  31.         }
  32.         else
  33.         {
  34.                 plan = "否";
  35.                 sl_plan_obj = document.getElementById('select_isplan');
  36.                 sl_plan_opbj.options.length=0;
  37.                 sl_plan_obj.options.add(new Option(plan,"value"));
  38.                 alert("否");
  39.         }
  40.         
  41. }
  42. </script>

  43. <td height="28" >變更日期:
  44. <input class="update" name="update" type="text" id="update" >
  45. <font color="#FF0000">*</font>
  46. <input type="button" id="time_sure" name="time_sure" value="確定" onclick="update_change();"> </td>
  47. <td height="28" ><label>是否計劃:
  48. <select class="sl_normal"  name="select_isplan" id="select_isplan">
  49.               <option>是</option>
  50.               <option>否</option>
  51.           </select></label></td>
復(fù)制代碼
當(dāng)我輸入日期  2011-12-28  這樣的形式
option就會刪除  增加一個是或者否選項

可是這里我的原因是if 塊里面的會執(zhí)行   else永遠(yuǎn)都不會執(zhí)行。。。條件邏輯我測試過是對的
不知道為什么。。。不知道俺說的清楚清楚。。求各位幫下

論壇徽章:
0
2 [報告]
發(fā)表于 2011-12-25 18:14 |只看該作者
頂上去- -

論壇徽章:
0
3 [報告]
發(fā)表于 2011-12-25 21:57 |只看該作者
自己手誤 寫錯了個對象。。。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP