工作的一些总结记录

学习总结
给SELECT 添加选择项
 jQuery(function () {
              for(var j=1;j<=12;j++)
                jQuery("#SelectMonth").append("<option value='"+j+"'>"+j+"</option>");
            });
选择 根据ID和值选中某一项
jQuery("#SelectYear option[value='"+year1[0]+"']").attr("selected",true) ;

ajx
 var xmlHttpReq = null;
        if (window.XMLHttpRequest){
          xmlHttpReq = new XMLHttpRequest();
        }
        else if (window.ActiveXObject){
           xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        }
        if(xmlHttpReq != null)
        { 
            xmlHttpReq.open("get","../MainItemHandler.ashx?year='"+syear+"'&month='"+smonth+"'&projectId="+projectid,true);
            xmlHttpReq.onreadystatechange=function ()
            {
               
              if(xmlHttpReq.readyState == 4)
               {
                if(xmlHttpReq.status==200)
                {
      
                  var result=xmlHttpReq.responseText;
                  if(result=="true")
                    {
                   
                      alert("该月份已经填过月报");
                      return;
                    }
                }
               }
            }
            xmlHttpReq.send(null);
       }

posted @ 2011-11-12 16:56  (二少)在南极  阅读(196)  评论(0编辑  收藏  举报