LoginSignup
0
1

More than 3 years have passed since last update.

【JQuery】This request has been blocked; the content must be served over HTTPS.と表示される。

Posted at

事象について

グラフを描画するために、以下JQueryを読み込む処理を記載した。

application.html.erb
<script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script>
<script type="text/javascript" src="http://techanjs.org/techan.min.js"></script>

すると・・・「techan.min.js」が読み込まれない。エラーを確認してみると

The page at 'https://74f8d60….vfs.cloud9.us-east-2.amazonaws.com/' was loaded over HTTPS, 
but requested an insecure script 'http://techanjs.org/techan.min.js'. 
This request has been blocked; the content must be served over HTTPS.

「このコンテンツはhttpのため、ブロックします。httpsにしてください」とのこと。

実施したこと

httpsに変更してみると・・・表示されない。元々httpsには対応してないみたいだ。
検索すると、httpsを省略しても読み込むことができるとのことなので、試してみる・・・。

<script type="text/javascript" src="//techanjs.org/techan.min.js"></script>

がっ・・・だめ・・・!コンテンツがhttpしかない場合、どうやってもブロックされるみたいだ。

対処法

普通にJQueryをダウンロードして、ファイルを「app/assets/javascripts」にぶち込んだら動いた!

image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1