jQuery ajax won't make HTTPS requests

后端 未结 2 841
闹比i
闹比i 2020-12-19 05:07

I\'m doing some pretty basic jQuery ajax stuff on my website, and I\'m having a boatload of trouble.

Here\'s the relevant code:

$(document).ready( fu         


        
相关标签:
2条回答
  • 2020-12-19 05:40

    301 Permanent Redirect may be happening. To check run Fiddler and watch the Result column. Usually 200 codes, but I spotted a 301 code.

    The https jquery ajax call was redirecting to http, causing the Mixed Content error.

    0 讨论(0)
  • 2020-12-19 05:59

    Try fixing the URL so your server doesn't have to redirect

    url: "/jsontest/randomdata/" // there was a missing trailing /
    
    // i.e.  https://larsendt.com/jsontest/randomdata?ymax=500&count=32&t=0.9604179110508643
    // was going to https://larsendt.com/jsontest/randomdata/?ymax=500&count=32&t=0.9604179110508643
    
    0 讨论(0)
提交回复
热议问题