日期:2014-05-16  浏览次数:20631 次

jQuery或$ 不能识别问题
相同界面 两种不同请求 一种是添加请求 一种是修改请求(通过Action跳转的) 添加请求jquery能用 点击修改时 jquery 不能识别。。。
这是什么问题?
贴界面代码:
income_edit.jsp
Java code

<%@ page language="java" pageEncoding="GBK"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
    <title>收入添加</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <script type="text/javascript" src="../jQuery/jquery-1.7.2.js"></script>
    <script src="../jQuery/jquery.form.js" type="text/javascript"></script>
    <script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" type="text/css" href="../images/styles.css">
    <script type="text/javascript">
    $(function() {
        $(".date").click(function() {
            WdatePicker();
        });
        $("#btn").click(function() {
            var url;
            if ($("#id").val() != null && $("#id").val() != "") {
                url = 'income!update';
            } else {
                url = 'income!add';
            }
            alert(url);
            var options = {
                url : url,
                type : 'POST',
                success : function(data) {
                    if (data) {
                        alert("添加成功!");
                        $("form").clearForm();
                    } else
                        alert("添加失败!");
                }
            };
            $("form").ajaxSubmit(options);
        });
    });
</script>
</head>
<body>
    <div class="div1">
        <table width="100%" cellpadding="0" cellspacing="0" border="0"
            align="center">
            <tr>
                <td class="td_title1">
                    · 当前位置 : 收入管理 &gt;&gt; 编辑收入
                </td>
            </tr>
            <tr>
                <td bgcolor="#FFFFFF" height="50">
                    <br>
                    <form action="" method="post" submit="return false;">
                        <input type="hidden" name="id" id="id" value="${income.id }">
                        <table border="0" align="center" width="450">
                            <tr>
                                <td align="right">
                                    日期:
                                </td>
                                <td align="left">
                                    <input type="text" class="date" name="date" value="<fmt:formatDate value='${income.date}' pattern='yyyy-MM-dd'/>"/>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    方式:
                                </td>