Jquery, No X-Requested-With=XMLHttpRequest in ajax request header?

后端 未结 6 1453
小鲜肉
小鲜肉 2020-12-14 03:35

SOME TIMES there is no X-Requested-With header, sometimes there is.

I checked in firebug and found that, don\'t know why.

So when I use requ

6条回答
  •  执念已碎
    2020-12-14 03:54

    I was just having the same problem myself, and I fixed it by ensuring there was a trailing slash after my url. So instead of:

    $.get('/example/url')
    

    use:

    $.get('example/url/')
    

    Looks like it's been a while since you posted this but maybe it will help!

提交回复
热议问题