Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Created October 31, 2011 17:20
Show Gist options
  • Select an option

  • Save kwhinnery/1328057 to your computer and use it in GitHub Desktop.

Select an option

Save kwhinnery/1328057 to your computer and use it in GitHub Desktop.
Ti.include, browser, and CommonJS module
//This variable will be the public interface of the module in a script tag or Ti.include
var globalNamespace = {};
(function (exports) {
exports.sayHello = function(str) {
alert('Hello '+str+'!');
};
}(typeof exports === 'object' && exports || globalNamespace));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment