Questions tagged [google-closure-library]

Closure Library is a JavaScript framework used by Google and one of three components to Closure Tools, an open source toolset to aid with developing front-end web applications

Important links:

373 questions
191
votes
8 answers

What does Google Closure Library offer over jQuery?

Considering business background community support available extensions default set of features simplicity of use and reliability why do you prefer one over the another?
pestaa
  • 4,723
  • 2
  • 20
  • 32
92
votes
3 answers

How can I log an HTML element as a JavaScript object?

Using Google Chrome, if you console.log an object, it lets you inspect the element in the console. For example: var a = { "foo" : "bar", "whiz" : "bang" }; console.log(a); This prints out Object which can be inspected by clicking on arrows next to…
Ben Flynn
  • 17,294
  • 18
  • 92
  • 133
67
votes
4 answers

How do I find out what functions are called when a button is pressed in Chrome Console?

I am trying to teach myself the Google Closure javascript library. I am examining the TreeControl UI widget. How can I use Chrome Console to analyze what functions are run when I click on the "Cut" button in the demo below? For instance, can I…
30
votes
5 answers

Is there a way to generate Javascript API documentation like the Google Closure Library API Documentation?

I'm trying to find a tool that generates HTML documentation for my Javascript source code. Does anyone know if the tool that Google uses to generate the interface at the following URLs is open source? Would I be able to generate similar output?…
26
votes
5 answers

Why check for !isNaN() after isFinite()?

I came across the goog.math.isFiniteNumber function in the Google Closure Library. What it does is checking whether a given number is both finite and not NaN. The underlying code is: goog.math.isFiniteNumber = function(num) { return isFinite(num)…
pimvdb
  • 141,012
  • 68
  • 291
  • 345
21
votes
7 answers

Using DOMContentReady considered anti-pattern by Google

A Google Closure library team member asserts that waiting for DOMContentReady event is a bad practice. The short story is that we don't want to wait for DOMContentReady (or worse the load event) since it leads to bad user experience. The UI…
19
votes
3 answers

How to merge .CSS files with Sass (or other tool)?

I can use Sass to compile multiple .SCSS or .SASS input files into a single .CSS output file using @import as described here. If I use @import to include normal .CSS files, they are not merged. The output .CSS file still contains the @import…
jwfearn
  • 26,394
  • 26
  • 89
  • 117
16
votes
7 answers

How can I load my own js module with goog.provide and goog.require?

We are trying to switch the packaging for our project from dojo to google closure, but we haven't had any luck so far. Here is a simple example that illustrates what we are trying to accomplish: …
Lightbeard
  • 3,421
  • 8
  • 42
  • 57
13
votes
3 answers

Google Closure Editor/WYSIWYG

Does anyone have experience with Google Closure Editor/WYSIWYG? I'm thinking of moving from CKEDITOR to Google Closure Editor/WYSIWYG. Ideally I'd love to use the etherpad editor but it doesn't appear that anyone has separated the editor from all…
AnApprentice
  • 97,752
  • 174
  • 583
  • 971
12
votes
3 answers

How can I pull an integer out of localstorage and coerce to an integer using clojurescript

I'm trying to pull an integer out of localStorage with a simple clojurescript app. Everything I've tried ended up trying has some sort of wrong behavior. Below is my program without initializing from local storage. I'll ignore the key not found…
Ball
  • 2,551
  • 3
  • 19
  • 25
12
votes
3 answers

How to host the google libphonenumber locally?

During development on my localhost, I am trying to self host the libphonenumber library. I am trying with the following:
blueFast
  • 33,335
  • 48
  • 165
  • 292
11
votes
1 answer

LimeJS Custom Sprite Swallowing events

I made a custom Lime JS sprite class by doing: test.obj = function() { lime.Sprite.call(this); . . this.label = new lime.Label(). ...; this.appendChild(this.label); } goog.inherits(test.obj, lime.Sprite); I'm unable to get the label click…
Brian Mains
  • 49,697
  • 35
  • 139
  • 249
10
votes
3 answers

Asynchronously delay JS until a condition is met

I have a class, ChatRoom, that can only render after it receives a long-running HTTP request (it could take 1 second or 30 seconds). So I need to delay rendering until ChatRoom.json is not null. In the code below, I'm using Closure Library's…
Amy B
  • 17,377
  • 12
  • 61
  • 81
10
votes
2 answers

Uncaught ReferenceError: require is not defined

For a project that I am working on I have been using a hodgepodge of JavaScript libraries. The main logic of my code is broken down into multiple commonjs modules. I use google closure to combine the modules into one output js file which I use…
pgreen2
  • 3,469
  • 3
  • 27
  • 53
9
votes
2 answers

How do i add the authenticity token?

I recently switched to Google closure for a new project. I am having trouble adding the authenticity token to the headers in a ajax call. How do i go about it? My Ajax snippet (using goog.net.XhrIo class): var initialHTMLContent =…
1
2 3
24 25