Created
June 12, 2012 13:39
-
-
Save yamamoto-febc/2917570 to your computer and use it in GitHub Desktop.
javascript docment2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var el = $(".selector"); | |
var controller = new MyWidget(el);//コントローラの生成 | |
console.log(controller.options.message); | |
//"Remove Me"と出力される | |
//パラメータを指定してコントローラ生成 | |
controller = new MyWidget(el, {message : "Don't Remove Me" } ); | |
console.log(controller.options.message); | |
//"Don't Remove Me"と出力される | |
//defaultsにないパラメータを指定してコントローラ生成 | |
controller = new MyWidget(el, {message : "Touch Me" , title : "MyTitle" } ); | |
console.log(controller.options.title); | |
//"MyTitle"と出力される |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment