日期:2014-05-17  浏览次数:20475 次

高分求教jquery动态创建的内容如何避免刷新后消失
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!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 id="Head1" runat="server">
    <title></title>

<script type="text/javascript" src="JS/jquery-1.4.1.js"></script>
    <script type="text/javascript">
        var tr;

        jQuery(document).ready(function () {
            jQuery("#TextBox3").blur(function () {
                var now = parseInt(jQuery("#TextBox3").val(), 10); //jQuery转换服务器控件值
                var num = parseInt(jQuery("#lblNow").html(), 10);
                if (now > num) {
                    alert("库存不足");
                }
            });

            jQuery("#Button1").click(function () {
                tr = "<tr>"
                                + "<td>借取人:<span>" + jQuery("#TextBox2").val() + "</span></td>"
                                + "<td>工具名:<span>" + jQuery("#DropDownList1").find("option:selected").text() + "</span></td>"
                                + "<td>已借出:<span>" + parseInt(jQuery("#lblBorrow").html(), 10) + "</span></td>"
                                + "<td>现存:<span>" + parseInt(jQuery("#lblNow").html(), 10) + "</span></td>"
                                + "<td>借取:<span>" + parseInt(jQuery("#TextBox3").val(), 10) + "</span></td>"
                                + "<td>总数:<span>"