{ "id": "97995", "key": "TIMOB-10167", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2017-06-26T22:11:23.000+0000", "created": "2012-07-25T12:57:51.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "community", "core" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-24T20:57:29.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "Please see my Q&A entry:\r\nhttp://developer.appcelerator.com/question/140151/cant-access-global-var-tifrom-included-function\r\n\r\n### In app.js: ###\r\nvar win = Ti.UI.createWindow({\r\n url: \"app2.js\", \r\n});\r\nwin.open();\r\n\r\n### In app2.js: ###\r\nvar steps = ['on', 'off'];\r\nTi.include('test.js');\r\n\r\n### In test.js: ###\r\nalert(steps[0]);\r\n\r\nThis fails. But if I were to move the steps definition to app.js, it works.\r\n\r\nThe 2.1.0 API docs state:\r\n\"The included JavaScript is interpreted in the current root execution context -- that is, either app.js or in the root context of a window opened with the url property.\"\r\nSo I assume the above should work; i.e. I should be able to define a global variable in the Windows context (app2.js) and have access to it from the included file (test.js) - but it seems to only work if I define the variable in app.js ONLY.\r\n", "attachment": [], "flagged": false, "summary": "MobileWeb: Variable defined in root window context is not accessible by included javascript file", "creator": { "name": "ttorimoto", "key": "ttorimoto", "displayName": "Taka Torimoto", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "ttorimoto", "key": "ttorimoto", "displayName": "Taka Torimoto", "active": true, "timeZone": "America/New_York" }, "environment": "Ti Studio 2.1.0.201206251749\r\nMobile SDK 2.1.0\r\nJRE 1.6.0_24\r\nWindows 7 Professional x64\r\n", "comment": { "comments": [ { "id": "427215", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Mobile Web has been deprecated and will be removed in fixVersion 7.0.0.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-08-24T20:57:29.000+0000", "updated": "2017-08-24T20:57:29.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }