The page at [url] ran insecure content from [url] in chrome

后端 未结 5 2061
梦谈多话
梦谈多话 2021-02-09 09:40

When i open a link this shows following message in chrome [blocked] The page at https://www.loadmytrailer.com/beta/postload.php ran insecure content from http://code.jquery.c

相关标签:
5条回答
  • 2021-02-09 09:54

    That's impossible. Chrome's security policy won't allow that.

    Option 1:

    Host the javascript you want to load remotely by yourself and link to it relatively.

    <script type="text/javascript" src="/my/assets/js/jquery/1.10.2/jquery.min.js"></script>
    

    Requesting a resource on your own server is protocol-independent

    Option 2:

    Use CDN's that support SSL. (Google for example)

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    

    A relative protocol notation can be used to request the source with the proper protocol depending on the protocol the current resource is using (see above).


    Side Note

    There is a command line parameter for Chrome called "-allow-running-insecure-content", which skips the insecure content check.

    I highly advise not to use it because you can't expect your users to have set that parameter.


    Further Reading

    • Google Chrome Help - "This page has insecure content"
    0 讨论(0)
  • 2021-02-09 09:54

    jquery ui is available also on https: https://code.jquery.com/ui/1.10.2/jquery-ui.js

    Link to https version if on https connection. Or host the file yourself.

    0 讨论(0)
  • 2021-02-09 09:59

    You can use protocol-relative URLs.The browser will use the page's protocol to try to obtain the file. On non-secure pages- http. On secure pages it will use https.

    For example, instead of:

    http://code.jquery.com/ui/1.10.2/jquery-ui.js
    

    ...you can use:

    //code.jquery.com/ui/1.10.2/jquery-ui.js
    

    ! notice absence of protocol

    0 讨论(0)
  • 2021-02-09 10:06

    For testing purposes, you could activate loading of insecure content by clicking the "shield" icon which would appear on the address bar in chrome.

    0 讨论(0)
  • 2021-02-09 10:18

    You could try hosting jquery-ui.js on your own server, assuming you control loadmytrailer.com.

    That way, it will be delivered to visitors over SSL, and their browsers will be happy that all content has arrived securely.

    0 讨论(0)
提交回复
热议问题