小编Bri*_*n F的帖子

ajax移动链接标签之外的链接文本

我有一个ajax请求来加载带有过滤信息的表.

例如:选择一名员工,点击"开始"以仅查看该员工的结果.

数据过滤得当.PHP在文件中显示ajax加载:

echo "<td><a href=\"creditcard.php?type=Edit&cc_id=".$cc_id."\" />Edit</a></td>";
Run Code Online (Sandbox Code Playgroud)

加载数据后,DOM显示:

<td><a href="creditcard.php?type=Edit&cc_id=8"></a>Edit</td>
Run Code Online (Sandbox Code Playgroud)

我的AJAX调用如下:

$('#go').live('click', function(e){
        e.preventDefault();
        $(this).hide();
        $(".Results").hide();
        $(".loading").html("<p>Loading...</p>");
        var employee = $('.employee').val();
        var cardtype = $('.cardtype').val();
        var startdate = $('.startdate').val();
        var enddate = $('.enddate').val();
        dataString = "ajax_employee="+employee+"&ajax_cardtype="+cardtype+"&ajax_startdate="+startdate+"&ajax_enddate="+enddate;
        $.ajax({
            type: "POST",
            url: "includes/creditcardsearch.php",
            data: dataString,
            success: function(result){
                $('.Results').html(result);
            },
            complete: function() {
                $(".loading").html('');
                $('.Results').fadeIn('slow');
                $("#go").show();
            }
        });
    });
Run Code Online (Sandbox Code Playgroud)

有没有人知道它为什么这样做?

php ajax jquery

0
推荐指数
1
解决办法
99
查看次数

标签 统计

ajax ×1

jquery ×1

php ×1