{ "id": "64171", "key": "TIMOB-3539", "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": [ { "id": "11357", "description": "Mobile 1.8.0 M04", "name": "Sprint 2011-25", "archived": true, "released": true, "releaseDate": "2011-06-27" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-07-07T11:15:55.000+0000", "created": "2011-04-15T03:46:27.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android" ], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" } ], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-07-07T11:15:55.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

evalJS() doesn't work, period, \r\non Android 2.2, but seems to on 1.6 and 3.0.

\r\n

However, communicating back from the webview to the application\r\ndoesn't work because there doesn't seem to be a similar mechanism\r\nin place as there is on iOS to inject the necessary Javascript at\r\nthe head of the HTML, resulting in errors like:

\r\n

E/Web Console( 504): ReferenceError: Can't find variable: Ti at\r\nfile: ...

\r\n

when trying to do something like Ti.App.fireEvent().

\r\n

For reference: \r\nhttp://developer.appcelerator.com/question/118231/ti-injection-for-webview-failing-on-android

{html}", "attachment": [], "flagged": false, "summary": "Android: No Ti Javascript injection to webview", "creator": { "name": "kt", "key": "kt", "displayName": "KT", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kt", "key": "kt", "displayName": "KT", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "157090", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "The following code demonstrates that Titanium now works as expected:\n\n{code:title=app.js}\nvar win = Ti.UI.createWindow({\n\tbackgroundColor : \"blue\",\n\texitOnClose:true\n});\n\nvar view = Ti.UI.createWebView({\n\tscalesPageToFit: false,\n\turl:'myweb.htm'\n});\nview.addEventListener('load', function() {\n\tTi.API.info(\"************TITLE: \" + view.evalJS(\"document.title\"));\n\tTi.API.info(\"************CONTENT: \" + view.evalJS('document.getElementsByTagName(\"html\")[0].innerHTML'));\n});\nwin.add(view);\nwin.open();\n{code}\n\n{code:title=myweb.htm}\n\n\n\n\nThis is the title\n\n\n
\n\t

Testing Titanium

\n\t
\n\t

This is the content

\n\t
\n
\n\n\n{code}", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-06-18T15:07:03.000+0000", "updated": "2011-06-18T15:07:03.000+0000" }, { "id": "157091", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Note this ticket is duplicated in TIMOB-3554", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-06-18T15:08:05.000+0000", "updated": "2011-06-18T15:08:05.000+0000" }, { "id": "158930", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid per Paul's comment.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-07T11:15:55.000+0000", "updated": "2011-07-07T11:15:55.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }