本帖最后由 lapertem4 于 2013-06-18 17:09:24 编辑

解决方案 »

  1.   

    改了一下还是不行 <div class="main">
    <div class="more">
    <?php
    require 'Admin/conn.php';
    require 'card.php';
    ?>
    </div>
    <a href="javascript:divadd();" class="get_more">更多­</a>
    </div>

    <script type="text/javascript">
    function divadd(){
    var olddiv = document.getElementById("more");
    var newdiv = document.createElement("require \'card.php\'");
    document.olddiv.appendChild.innerHTML(newdiv);
    }
    </script>
      

  2.   


    没有看到ID为get_more和more的元素,
    其次,createElement要加个参数,就是你要创建的标签
    var div = document.createElement('div');
      

  3.   

    没有看到ID为more的元素啊,
    添加元素直接appendChild就行了
    olddiv.appendChild(newdiv);
      

  4.   

    没有看到ID为more的元素啊,
    添加元素直接appendChild就行了
    olddiv.appendChild(newdiv);sorry  我的那个more是个类,必须要改为ID是么,
    我试试直接appendChild,那他附加到哪呢,</div> 里面or外面?
      

  5.   

    function divadd(){
        var olddiv = document.getElementById("more");
        var newdiv = document.createElement('div');
        newdiv.innerHTML = olddiv.innerHTML;
        olddiv.parent.appendChild.innerHTML(newdiv);
    }我认为你只是要复制 一个div 并插入
    如果不是 那个必须用ajax
      

  6.   

    没有看到ID为more的元素啊,
    添加元素直接appendChild就行了
    olddiv.appendChild(newdiv);sorry  我的那个more是个类,必须要改为ID是么,
    我试试直接appendChild,那他附加到哪呢,</div> 里面or外面?
    因为document.getElementById是根据ID来获取元素的,你没有ID为more的那个元素,所以获取不到,appendChild是附加到DIV里面的。