weixin_33725272 2016-12-23 23:37 采纳率: 0%
浏览 30

ajax发布将数据追加到url

I searched for this problem but the answers I found haven't worked for me. Here is my js script.

$("#edit-btn").click(function() {
$.ajax({
    method: "POST",
    url: $(this).data("url"),
    data: { "UserID" : $(this).data("id") },
    success: function(data, textStatus, jqXHR){
        alert(textStatus);
    },
    error: function(jqXHR, textStatus, errorThrown){
        alert(textStatus);
    }
})

})

When this code is executed, I get "The requested URL /user_update.php4 was not found on this server." in my browser. "user_update.php" is the value of $(this).data("url") and "4" is the value of $(this).data("id").

Any help most welcome.

  • 写回答

1条回答 默认 最新

  • helloxielan 2016-12-24 17:33
    关注

    Thanks for the input. This morning, the same code is working. My computer has been closed down and started up again since I posted the question so maybe there was an issue that was fixed that way or maybe javascript caching (I changed the script several times). In any case, all is working OK now. Pete

    评论

报告相同问题?

悬赏问题

  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案
  • ¥50 winform中使用edge的Kiosk模式
  • ¥15 关于#python#的问题:功能监听网页
  • ¥15 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化