javascript - 如何使用 createElement 修复 adapt.min.js 文件?当站点使用 SSL 时产生错误

标签 javascript createelement adapt

我在我的站点中使用 SSL,我有这个错误:

combine.js:6 Mixed Content: The page at 'https://www.******.com/' was loaded over HTTPS, but requested an insecure font 'http://themes.googleusercontent.com/static/fonts/archivonarrow/v3/DsLzC9scoPnrGiwYYMQXpp4t0mJKPaLVqklzZuc32b4.woff'. This request has been blocked; the content must be served over HTTPS.

combine.js:6 Mixed Content: The page at 'https://www.******.com/' was loaded over HTTPS, but requested an insecure font 'http://themes.googleusercontent.com/static/fonts/archivonarrow/v3/M__Wu4PAmHf4YZvQM8tWsHhM4mdXpoxYNWk7Ev34U70.woff'. This request has been blocked; the content must be served over HTTPS.

combine.js:6 Mixed Content: The page at 'https://www.******.com/' was loaded over HTTPS, but requested an insecure font 'http://fonts.gstatic.com/s/montserrat/v6/zhcz-_WihjSQC0oHJ9TCYPk_vArhqVIZ0nv9q090hN8.woff2'. This request has been blocked; the content must be served over HTTPS.

combine.js:6 Mixed Content: The page at 'https://www.******.com/' was loaded over HTTPS, but requested an insecure font 'http://fonts.gstatic.com/s/montserrat/v6/IQHow_FEYlDC4Gzy_m8fcoWiMMZ7xLd792ULpGE4W_Y.woff2'. This request has been blocked; the content must be served over HTTPS.

所有这些错误都来自这一行

!function(a,b,c,d){function m(a,b){l.href=e,f=e,h(a,b)}function n(){clearTimeout(g);var c,h,n,o,p,q,a=b.documentElement?b.documentElement.clientWidth:0,r=k,s=k-1;for(e=d;r--;)if(c=j[r].split("="),h=c[0],q=c[1]?c[1].replace(/\s/g,""):d,p=h.match("to"),n=p?parseInt(h.split("to")[0],10):parseInt(h,10),o=p?parseInt(h.split("to")[1],10):d,!o&&r===s&&a>n||a>n&&o>=a){q&&(e=i+q);break}f?f!==e&&m(r,a):(m(r,a),e&&(b.head||b.getElementsByTagName("head")[0]).appendChild(l))}function o(){clearTimeout(g),g=setTimeout(n,16)}if(c){var e,f,g,h=c.callback||function(){},i=c.path?c.path:"",j=c.range,k=j.length,l=b.createElement("link");l.rel="stylesheet",l.media="screen",n(),c.dynamic&&(a.addEventListener?a.addEventListener("resize",o,!1):a.attachEvent?a.attachEvent("onresize",o):a.onresize=o)}}(this,this.document,ADAPT_CONFIG);

我的网站使用 SSL,并且 url 必须是 https 我需要修复它,我对 .js 一无所知,只是我为所有 .js 文件做了合并

我在这里添加错误 adapt.min.js SSL bug 如何在 createElement 中使用 https?

最佳答案

如果你看错误 您会看到它已因 HTTPS 而损坏。这意味着 您不应在调用站点的地方使用 HTTPS。 请将 HTTPS 更改为 HTTP 并告诉我您是否遇到其他错误

你可以找到更多关于这个的信息 question

关于javascript - 如何使用 createElement 修复 adapt.min.js 文件?当站点使用 SSL 时产生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52146239/

相关文章:

javascript - PHP - 无法正确发送 JSON

javascript - 如何使用 JavaScript 更改 HTML 文档的背景颜色

javascript - 如何修复appendChild()来创建div元素节点?

vue.js - 如何在 VueJs 中将 child 渲染到指定的命名插槽中?

javascript - 使用 Electron 和 Asar 打包应用程序

javascript - 当点击最后一张幻灯片上的下一页时,转到 WordPress 中的下一页?

javascript - 用 javascript 插入的新元素可以通过 view-source 看到吗?

android - Div 底部工具栏出现在 iPhone 但不是在 Android 上

javascript - 使用透视层在网页顶部加载图像的方法是什么?