无法通过ajax传递jquery可排序值

时间:2014-07-03 09:16:59

标签: javascript php jquery ajax html-table

我有两个表,我让它们可以排序,但唯一缺少的是我现在无法通过ajax传递可排序的表值。只是一个小错误我在某处做。这是jsfiddle:demo 这是我的代码: dashboard.php

<pre>
    <div id="info"></div>
    </pre>  
    <div id="widget_update">
    <div id="Fahrzeuge" /><img src="/admin/images/arrow.png" alt="move" width="16" height="16" class="handle" />
        <table width="538" cellspacing="0" cellpadding="0" border="0" >
        <tr>
            <td id="fahrzeuge">

            </td>
        </tr>
    </table>
    </div>
    <div id="NEWS" /><img src="/admin/images/arrow.png" alt="move" width="16" height="16" class="handle" />
        <table width="538" cellspacing="0" cellpadding="0" border="0">
        <tr>
            <td id="news">          
            </td>
        </tr>
    </table>
    </div>
    </div>

dashboard.js

$("#widget_update").sortable({
      handle : '.handle',
      update : function () {
          var widget = $('#widget_update').sortable('serialize');         
        $.ajax({
        type: "POST",
        url: "ajax/dashboard.php",
        dataType : 'json',
        cache: false,
        data: {'aktion' : 'show-widget','widget':widget},
        success: function(data){
            $('#widget').html(data.html);
            //location.reload();    
            //showwidget();                 
        },
        error: function(data){
            alert('Cant delete all widget!!!! Press cancel to go back main menu!!!!');
            //location.reload();
        }
        });
      }
});      

1 个答案:

答案 0 :(得分:0)

不完全确定您在按钮功能方面要实现的目标,但重要的是要注意{j} 1.7已弃用jQuery live() function