我写了一个jquary 
html格式能用  复制到aspx下就没反应了  为什么啊  
我是新手 请高手指教

解决方案 »

  1.   

    就引用了一个jquary的包 别的没有了啊 。。
      

  2.   

    <script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
        <script type="text/javascript" src="Scripts/jquery-1.5.min.js"></script>
        <style type="text/css" >
     body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre, 
    form,fieldset,input,textarea,p,blockquote,th,td { 
    padding:0;
    margin:0;
    }
    table{
    border-collapse:collapse;
    border-spacing:0;
    }
    /* Reset */
    .cShop table{ width:500px; font:12px/22px Arial,Helvetica,sans-serif,"宋体";}
    .cShop table th,.cShop table td{ border:1px solid gray;}
    .cShop table td{ text-align:center;}
    .cShop table td b{ cursor:pointer;}
    .cShop table td b:hover{ color:red;}
    .cShop .cShopText{ width:2em;}
        </style>
        <script type="text/javascript" language="javascript">
    function jChas(tempId,tempJg,tempName){
    var faDiv = $('div.cShop').find('table');

    var tempHtml = '';
    tempHtml += '<tr>';
    tempHtml += '<td>' + tempId + '</td>';
    tempHtml += '<td>' + tempName + '</td>';
    tempHtml += '<td>' + tempJg + '</td>';
    tempHtml += '<td>' + 1 + '</td>';
    tempHtml += '<td><b class="Kai">改</b>&nbsp;<b class="Del">删</b></td>';
    tempHtml += '</tr>';
    faDiv.append(tempHtml);

    sPlay();
    }
    var finArr = new Array();
    function sPlay(){
    var tempObj = $('div.cShop').find('table tr');
    var cNum = 0;
    var cPrice = 0; $('div.cShop').find('table tr').slice(1).each(function(){
    cNum += parseInt($(this).find('td').eq(3).html());
    cPrice += parseInt($(this).find('td').eq(2).html()) * parseInt($(this).find('td').eq(3).html());
    });

    var tempHtml = '菜数' + cNum + '个 金额' + cPrice + '元 其中0个价格未知';
    $('div.sPlay').html(tempHtml);
    }jQuery(function($) { //删除函数
    function jDel(tempThis){
    tempThis.parent().parent().detach();
    sPlay();
    }
    //修改函数
    function jKai(tempThis){
    var tempObj = tempThis.parent().prev();
    var tempVal = tempObj.html();
    /*
     * 判断是否为数字.数量只能是数字
     */
    var re = /^[0-9]*[1-9][0-9]*$/;
    if(!re.test(tempVal)){
    return;
    }
    else{
    var tempHtml = '';
    tempHtml += '<input type="text" class="cShopText" value="' + tempVal + '">';
    tempHtml += '<input type="button" class="Vbtn" value="确认">';
    tempObj.html(tempHtml);
    }
    }
    //还原函数
    function jHuan(tempThis){
    var tempVal = tempThis.prev().val();
    /*
     * 判断是否为数字.数量只能是数字
     */
    var re = /^[0-9]*[1-9][0-9]*$/;
    if(!re.test(tempVal)){
    alert('请正确填写价格');
    return;
    }
    else{
    tempThis.parent().html(tempVal);
    }
    sPlay();
    }
    //删除
    $('b.Del').live('click',function(){
    var _this = $(this);
    jDel(_this);
    });
    //修改
    $('b.Kai').live('click',function(){
    var _this = $(this);
    jKai(_this);
    });
    //还原
    $('.Vbtn').live('click',function(){
    var _this = $(this);
    jHuan(_this);
    });
    //插入    </script><div class="cMenu">
    <ul>
         <li>
             <div id="pro_101" title="abc"><img src="image/pro_001.jpg"></div>
                <input class="proJ" type="button" value="enter" onclick="jChas('111','11','aa')">
            </li>
            <li>
             <div id="pro_102" title="efg" price="120"><img src="image/pro_002.jpg"></div>
                <input class="proJ" type="button" value="enter" onclick="jChas('222','22','bb')">
            </li>
            <li>
             <div id="pro_103" title="hig" price="90"><img src="image/pro_002.jpg"></div>
                <input class="proJ" type="button" value="enter" onclick="jChas'333','33','cc')">
            </li>
        </ul>
    </div><br /><!-- 这里是购物车^ω^ -->
    <div class="cShop">
    <table>
         <tr>
             <th>序号ID</th>
                <th width="50%">菜品/单位</th>
                <th>价格</th>
                <th>数量</th>
                <th>操作</th>
            </tr>
        </table>
    </div><br /><!-- 最终显示区 -->
    <div class="sPlay">菜数0个 金额0元 其中0个价格未知</div>
      

  3.   

    我把代码全贴上而来  谁能帮我看看 问题到底出在哪里啊?
    html下完全能用   但放到aspx下就没有用了 
    不是说与环境无关 只要引用包就行了吗  
    可我包页引用过了  为什么还是不行呢?
      

  4.   

    你把这些代码放在源里 
    建立个Scripts这个文件夹把jquery-1.4.1.min.js放进去
    你这个里面怎么有2个版本1.5 和1.4?
      

  5.   

    就引用了jquary的包  但依然没有用啊
      

  6.   

    这个就是从scripts的文件夹里引用的呀  
    之前我也分别就引用两个中的一个版本  也没反应啊。。
      

  7.   

    lz jquery库只需要引用一个  多了会有冲突。