{ "id": "106512", "key": "TIMOB-12095", "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": "2012-12-14T00:54:11.000+0000", "created": "2012-12-14T00:41:52.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "56345", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "171129", "key": "TIMOB-25786", "fields": { "summary": "Android: WebView eval JS timeout error ", "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" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-03-02T01:37:49.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": "Example:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\t\r\n});\r\nvar webview = Ti.UI.createWebView({\r\n\turl: 'test.html'\r\n});\r\n\r\nwebview.evalJS('var phrases = {}');\r\nwebview.evalJS('phrases.breakfast = \"' + L('breakfast') + '\"');\r\nwebview.evalJS('phrases.nutritional_values = \"' + L('nutritional_values') + '\"');\r\n\r\nwin.add(webview);\r\n\r\nwin.open();\r\n{code}\r\n\r\ntest.html file:\r\n\r\n{code}\r\n\r\n\r\n\r\n\tlocal webview\r\n\r\n\r\n\tThis is a test\r\n\t\r\n\r\n\t\r\n\r\n\r\n{code}\r\n\r\nExpected result:\r\nYou should see the value 'breakfast' printed out as it does in iOS\r\n\r\nActual result:\r\nThe value is undefined and nothing prints out.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: EvalJS does not work before a webview is loaded", "creator": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "231376", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This can't be fixed in android since we rely on the webview to run evalJS. We use loadURL('javascript:') to run the javascript code. If we do this before we actually load the webpage, it won't work since the previous javascript context will be wiped out once the actual webpage loads.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-14T00:54:11.000+0000", "updated": "2012-12-14T00:54:11.000+0000" }, { "id": "233797", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing based on Allen's comments.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-10T09:41:02.000+0000", "updated": "2013-01-10T09:41:02.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }