Frage

For one of my projects, I need to load the google closure library:

<script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js"></script>

But I am getting:

[blocked] The page at http://xxx/index.html ran insecure content from http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js.

How can I use the google closure library in my project?

War es hilfreich?

Lösung

If your site is running on HTTPS, then you need to access the Google Closure Library via HTTPS as well. Try using a protocol-relative link to keep your site's protocol usage consistent with the way it retrieves the Google Closure code.

<script src="//closure-library.googlecode.com/svn/trunk/closure/goog/base.js""></script>

Andere Tipps

I know the question is for base.js , there is also a compiled library in one JS file.

<script src="http://resources.programmingclosure.com/closure-lite.js"></script>

Source : http://www.programmingclosure.com/closure-lite/

Closure Lite API

Closure Lite includes the following APIs from Closure:

  • goog.array
  • goog.Disposable
  • goog.dispose
  • goog.dom
  • goog.dom.DomHelper
  • goog.events.NodeType
  • goog.dom.TagName
  • goog.dom.classes
  • goog.dom.xml
  • goog.events
  • goog.events.BrowserEvent
  • goog.events.Event
  • goog.events.EventHandler
  • goog.events.EventType
  • goog.events.EventTarget
  • goog.events.KeyEvent
  • goog.events.KeyCodes
  • goog.events.KeyHandler
  • goog.events.Listener
  • goog.functions
  • goog.json
  • goog.math.Box
  • goog.math.Coordinate
  • goog.math.Rect
  • goog.math.Size
  • goog.net.ErrorCode
  • goog.net.EventType
  • goog.net.XhrIo
  • goog.net.XhrMonitor
  • goog.net.XmlHttp
  • goog.object
  • goog.string
  • goog.structs
  • goog.structs.Map
  • goog.structs.Set
  • goog.style
  • goog.Timer
  • goog.userAgent
  • goog.userAgent.product
  • goog.window

EDIT : from http://www.programmingclosure.com/closure-lite/ A single JavaScript file that contains the core of the Closure Library

Closure Lite aims to solve this problem by providing the core of the Closure Library in a single, minified JavaScript file that can be included in your own web page.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top