Skip to content

Instantly share code, notes, and snippets.

@kamito
Created May 25, 2011 15:19
Show Gist options
  • Select an option

  • Save kamito/991157 to your computer and use it in GitHub Desktop.

Select an option

Save kamito/991157 to your computer and use it in GitHub Desktop.
/**
* app.js
*/
// オブジェクト領域を確保する
goog.provide("app");
goog.provide("app.Base");
goog.provide("app.Page");
goog.require("goog.dom"); // DOM関連ライブラリを読み込む
app.Base = function() {
};
app.Page = function() {
var content_elm = goog.dom.getElement('content'); // #contentを取得
goog.dom.setTextContent(content_elm, "Hello! Closure."); // テキストをセット
};
goog.inherits(app.Page, app.Base);
goog.addSingletonGetter(app.Page);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment