JQuery 加载无效的安全证书错误

JQuery Load Invalid Security Certificate Error

我无法用 JQuery 加载 web-page/website,因为该网站的安全证书无效。 有没有办法用 JQuery 强制加载带有无效安全证书的网站?

我的 FireFox 控制台出现以下错误:

www.example.com uses an invalid security certificate. The certificate is not trusted because it is self-signed. The certificate is only valid for new.example.com Error code: SEC_ERROR_UNKNOWN_ISSUER

我的测试代码是:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("button").click(function(){
        $("#div1").load("https://www.example.com");
    });
});

</script>

</head>
<body>

<div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>

<button>Get External Content</button>

</body>
</html>

你不能。只有用户(或本地程序)可以在浏览器中添加例外。

下载jquery个文件并建立本地链接,不要使用其他服务器的在线链接。