タグ

JavaScriptとCDNに関するKimuraのブックマーク (2)

  • いい加減、<script src="http://.. と書くのはやめましょう - DQNEO起業日記

    外部サイトのJSファイルを読み込むときに、こういう書き方するのはやめましょう。 <script src="http://example.com/js/jquery.js"></script> 理由 あなたのサイトが、いつの日かSSLに対応することになったとき、そのscriptタグがバグの原因になります。 ご覧のとおり、HTTPSページの中でHTTP要素を読み込もうとすると、ブラウザによっては安全装置が働いて読み込んでくれないのです。 上の例ではjQueryの読み込みに失敗していますが、エラーメッセージ「Uncaught ReferenceError: jQuery is not defined 」を見てもHTTPS/HTTPのプロトコルが原因だとはすぐ気づかないので、わかりにくいバグになってしまいます。 結論 JSファイル(とかCSSとか画像とか)を読み込むときは、"http:"の部分を省

    Kimura
    Kimura 2013/05/20
    https://の時の事も考えて書こう!というお話。私は「意外と知らない人」の方でした。がーん。
  • jQuery google api and other google hosted javascript libraries. - ScriptSrc.net

    Mastering the Code Things We Wish We Knew Much Earlier In Our Career - Articles, Tips, Inspirations, Sources and Resources for web designers and developers Watch video Hello, coders! Computer Science became one of the top professions and hobbies in the past two decades. Many people, especially website developers, are drawn to learn at least one programming language that will back up their written

    Kimura
    Kimura 2012/06/13
    Google CDNサービスのscript要素を簡単に取得できるサイト。「Copy」をクリックで<script>タグがクリップボードにコピーされる。
  • 1