Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capabilities #1

Open
ghost opened this issue Feb 22, 2012 · 1 comment
Open

Capabilities #1

ghost opened this issue Feb 22, 2012 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 22, 2012

Hi there, nice work here. I've successfully got this working.

I'm just curious to know if this is only for logging, or if I can manipulate objects as well.

For example, can I do something like "myView.width = 50" and see the UI update on my device?

I haven't been able to get anything but alert() to work.

Thanks!

@sukima
Copy link

sukima commented Jul 12, 2013

The current code uses JavaScript eval:

eval("(function(){" + your_code + "})();");

Because it is wrapped inside an IIFE you do not have access to local scope. You can only access exported functions / variables. And since Titanium uses CommonJS you would have to require() the module first then interact with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant