Can't call function using ajax

前端 未结 3 1230
眼角桃花
眼角桃花 2021-01-29 09:05

I\'m trying to call a function using ajax, but it\'s not responding.

Here is the Code:

3条回答
  •  梦如初夏
    2021-01-29 09:27

    i thing the problem is in this line:

    url: '@Url.Action("Remove", "ReadingNow")?Book_id=' + myId

    dont use @Url.Action that is not the current syntax to use razor in JS (you need to use the pseudo-element), just write the url ["/ReadingNow/Remove?Book_id="+id]. that way you know for sure where the request will go and it easier to read.

提交回复
热议问题