直接在ul外加个form就是了,干嘛要消失,非要把1+1换算成1+100000*0+1你才高兴啊?

解决方案 »

  1.   

    看出来了.....这是在类似AJAX那种应用..
    我去写写看
      

  2.   

    不用吧...
    代码:
    <html><head>
    <meta http-equiv="Content-Language" content="zh-cn" />
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>Test 7 - 原位编辑</title>
    <script type="text/javascript">
    // Code by Hidden, Inner Group (CSDN: gladisionboy)
    var formnode=null;
    var prevEdit=null;window.onload=function () {
    formnode=ajaxList_post.removeNode(true);
    formnode.onsubmit=onaftereditinplace;
    formnode.style.display="inline"; for(var i=0; i<ajaxList.childNodes.length; i++) {
    ajaxList.childNodes[i].childNodes[0].onclick=onbeforeeditinplace;
    }

    }function onbeforeeditinplace() {
    if(prevEdit)
    return false;
    var a=event.srcElement;
    a.style.display="none";
    a.insertAdjacentElement("afterend", formnode);
    ajaxList_post.ajax_value.value=a.innerHTML;
    prevEdit=a;
    return false;
    }function onaftereditinplace() {
    var a=ajaxList_post.previousSibling;
    a.innerHTML=ajaxList_post.ajax_value.value;
    formnode=ajaxList_post.removeNode(true);
    a.style.display="";
    prevEdit=null;
    return false;
    }</script>
    </head><body>
    <form name="ajaxList_post" method="GET" style="display: none;">
    <input type="text" size="40" value="" name="ajax_value" />
    <input type="submit" value="修改" />
    </form><ul id="ajaxList">
    <li><a href="#">a</a></li>
    <li><a href="#">b</a></li>
    <li><a href="#">c</a></li>
    <li><a href="#">d</a></li>
    <li><a href="#">e</a></li>
    </ul>
    </body></html>