Skip to main content
Code Review

Return to Answer

You should also wrap your code into a namespace with IIFE to avoid global conflict and immediate execution.

i.e.

(function (token, undefined) {
 token.init = function () {
 var self = this;
 //add event handler
 $('#friend').on('keyup', function (event) {
 //test data to make sure its usable
 self.testData( $(this) , event );
 });
 };
}(window.token = window.token || {}));

You should also wrap your code into a namespace with IIFE to avoid global conflict and immediate execution.

i.e.

(function (token, undefined) {
 token.init = function () {
 var self = this;
 //add event handler
 $('#friend').on('keyup', function (event) {
 //test data to make sure its usable
 self.testData( $(this) , event );
 });
 };
}(window.token = window.token || {}));

You should also wrap your code into a namespace with IIFE to avoid global conflict.

i.e.

(function (token, undefined) {
 token.init = function () {
 var self = this;
 //add event handler
 $('#friend').on('keyup', function (event) {
 //test data to make sure its usable
 self.testData( $(this) , event );
 });
 };
}(window.token = window.token || {}));
Source Link

You should also wrap your code into a namespace with IIFE to avoid global conflict and immediate execution.

i.e.

(function (token, undefined) {
 token.init = function () {
 var self = this;
 //add event handler
 $('#friend').on('keyup', function (event) {
 //test data to make sure its usable
 self.testData( $(this) , event );
 });
 };
}(window.token = window.token || {}));
default

AltStyle によって変換されたページ (->オリジナル) /