1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

大家帮我看看,我的条件判断语句是否正确

本帖由 小狼2006-05-10 发布。版面名称:后端开发

  1. 小狼

    小狼 New Member

    注册:
    2006-03-15
    帖子:
    163
    赞:
    1
    <!--#include file="../../public/showdate.asp"-->
    <%
    if session("rolename")="董事长" then
    %>
    <script language="javascript">
    <!--
    function check(obj){
    var sData = dialogArguments;
    var url = "PlanIfrm1.asp?method=query";
    var q_employee_name = obj.employee_name.value.replace(/'/g,"''");
    q_area=obj.area.value;
    q_sdate = obj.sdate.value;
    q_edate = obj.edate.value;
    q_name = obj.name.value;
    obj = eval(obj);
    String.prototype.Trim = function(){
    return this.replace(/(^\s*)|(\s*$)/g, "");
    }

    var sdate1 = new Date(obj.sdate.value);
    var edate1 = new Date(obj.edate.value);
    if (sdate1 > edate1){
    q_sdate = obj.edate.value;
    q_edate = obj.sdate.value;
    }
    if (q_area.Trim() != ""){
    url = url + "&area="+q_area+""
    }
    if (q_employee_name.Trim() != ""){
    url = url + "&employee_name="+q_employee_name+""
    }
    if (q_name.Trim() != ""){
    url = url + "&name="+q_name+""
    }
    if(q_sdate.Trim() != ""){
    url = url + "&sdate="+q_sdate+""
    }
    if(q_edate.Trim() != ""){
    url = url + "&edate="+q_edate+""
    }
    sData.document.frames("IFrm").location.href = url;
    }
    </script>
    <% else %>
    <script language="javascript">
    <!--
    function check(obj){
    var sData = dialogArguments;
    var url = "PlanIfrm.asp?method=query";
    var q_employee_name = obj.employee_name.value.replace(/'/g,"''");
    q_area=obj.area.value;
    q_sdate = obj.sdate.value;
    q_edate = obj.edate.value;
    q_name = obj.name.value;
    obj = eval(obj);
    String.prototype.Trim = function(){
    return this.replace(/(^\s*)|(\s*$)/g, "");
    }

    var sdate1 = new Date(obj.sdate.value);
    var edate1 = new Date(obj.edate.value);
    if (sdate1 > edate1){
    q_sdate = obj.edate.value;
    q_edate = obj.sdate.value;
    }
    if (q_area.Trim() != ""){
    url = url + "&area="+q_area+""
    }
    if (q_employee_name.Trim() != ""){
    url = url + "&employee_name="+q_employee_name+""
    }
    if (q_name.Trim() != ""){
    url = url + "&name="+q_name+""
    }
    if(q_sdate.Trim() != ""){
    url = url + "&sdate="+q_sdate+""
    }
    if(q_edate.Trim() != ""){
    url = url + "&edate="+q_edate+""
    }
    sData.document.frames("IFrm").location.href = url;
    }
    </script>
    <% end if %>
     
  2. 风狼

    风狼 New Member

    注册:
    2005-10-01
    帖子:
    7,452
    赞:
    25
    测试一下不就知道了?
     
  3. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    我倒,看这些头疼。
     
  4. 小狼

    小狼 New Member

    注册:
    2006-03-15
    帖子:
    163
    赞:
    1
    就是测试的时候出了问题啊!
    本来按照我的想法是做一个条件判断,
    来执行我的JAVASCRIPT
     
  5. 小狼

    小狼 New Member

    注册:
    2006-03-15
    帖子:
    163
    赞:
    1
    javascript是没有错误的,
    你们只要看我的条件判断看有没有错误
     
  6. 风狼

    风狼 New Member

    注册:
    2005-10-01
    帖子:
    7,452
    赞:
    25
    if语句也没错呀。
     
  7. 小狼

    小狼 New Member

    注册:
    2006-03-15
    帖子:
    163
    赞:
    1
    没问题了,
    自己的问题自己弄~~
    哈哈

    还有N天到六一
    先祝大家六一快乐
     
  8. 风狼

    风狼 New Member

    注册:
    2005-10-01
    帖子:
    7,452
    赞:
    25
    :mummy:

    六一~~~