Community Questions & Answers

CommonJS module

In my module there is a function that needs to be exposed and used internally. Here is what I do: ~~~ var foo = function(){}; //to expose exports.foo = foo; //to use internally foo(); ~~~ or more simple: ~~~ //to expose exports.foo =...

Probably simple Q regarding commonjs

(Building for both Android and Iphone) Hi I am new to commonjs and this is my problem: On startup of my app, I check if I am connected to the net, if so I grab a fresh json file on a server and I set the fresh json (in "json.js"). In...

CommonJS Module

I found this on the docs: The global scope of app.js is not accessible from other contexts or within CommonJS modules. So, you can't just dump variables there so you can access them throughout your app. Wait. I thought any variable I declare in app.js is...

No window settings?

I am opening a new window, but i cant get any of the attributes to work except color. Im using commonjs to open a new window from a slide menu. Here is some sample code. For IOS Any...

how to seperate codes blocks

I would like to seperate my index.js code blocks to diffrent js file. Is that posible? For example; template.js (which is in asset folder) as below ~~~ var plainTemplate = { childTemplates: [ { type: 'Ti.UI.Label', // Use a...

Window opening using slide menu

Hi I am using Titanium Studio, build: 3.2.3.201404181442, on a Mac Book OS10. I am making IOS app using a slide menu. I am using NappSlideMenu found here. https://github.com/viezel/NappSlideMenu. My problem is that I cannot open a new window from any...

Using databases with CommonJS

Hi, I have a CommonJS module for a text area where the user can input the name of a task. In my app, I am wanting to have multiple windows for different task groups(such as art or design) that include this text area. However, I am wanting to save each...

CommonJS Objects Problems

Ti SDK 3.2.2.GA CLI 3.2.3 IOS SDK: 7.1 IOS simulator 3.5 Im starting developer with Alloy and CommonJS, and I have a problem with the scope of the objects: ~~~ //median.js function...

SOAP web services

I am made a SOAP web services, and I need to pull into my app the table that is displayed on the web service. What code do I use for android and iPhone devices to display the table that the web service reads? I am using titanium SDK version 3.2.2...

module call

why it will appear error? how to solve it V8Exception: Exception occurred at undefined:1: Uncaught SyntaxError: Unexpected token u app.js ~~~ var gallery = require('gallery'); var win = Ti.UI.createWindow({ title:'Gallery' }); var btn =...

commonJS organize module

program below operate well, how to move function getDis() on win2 to another new module without error ? my program code look like below for app.js i create a layout ~~~ var gallery = require('gallery'); var tableRow=[]; var pageNum =1; var win =...

organize module, commonJS passing parameter

i want to move the function getDis to another module, how to do that? app.js i create a layout ~~~ var gallery = require('gallery'); var tableRow=[]; var pageNum =1; var win = Ti.UI.createWindow({ title:'test Manage Data' }); ...

Custom UI Component

Hello there, I have a custom component defined like this: /app/article.js ~~~ exports.createArticleViewContent = function(title) { var articleTitle = Ti.UI.createLabel({ text:title }) return(articleTitle); } ~~~ and I am calling it from my app.js...

Showing 1-50 of 381 1 2 3 4 5 68