{ "id": "127906", "key": "TIMOB-16650", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-04-02T22:19:44.000+0000", "created": "2014-03-20T17:06:52.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "supportTeam" ], "versions": [], "issuelinks": [ { "id": "36334", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "125611", "key": "TIMOB-16781", "fields": { "summary": "BlackBerry: TiUIWebview does not return evalJS data", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-13T20:59:40.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": "10230", "name": "BlackBerry", "description": "BlackBerry Platform" } ], "description": "h2. Problem description\r\nWhen calling evalJS on a webview in BB10, the javascript is invoked, but there is no return value.\r\n\r\nh2. Code sample\r\nJust use this code:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor:'white'\r\n});\r\n \r\nvar webview = Ti.UI.createWebView({\r\n url : 'http://www.example.com'\r\n});\r\n \r\n \r\nwebview.addEventListener('load', function() {\r\n alert(webview.evalJS('window.location.href'));\r\n});\r\n \r\nwin.add(webview);\r\nwin.open();\r\n{code}\r\n\r\nh2. Note\r\nevalJS works. Replace the alert with this to verify:\r\n\r\n{code}\r\nwebview.evalJS('alert(window.location.href)');\r\n{code}", "attachment": [], "flagged": false, "summary": "BlackBerry: Calling webview.evalJS works, but does NOT return a value", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "299451", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The API will be the following. BB's evalJS implementation is async\n{code}\nwebview.evalJS('window.location.href', function(){\n\talert(e.result);\n});\n{code}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-01T00:11:47.000+0000", "updated": "2014-04-01T00:11:47.000+0000" }, { "id": "299452", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR Pending https://github.com/appcelerator/titanium_mobile_blackberry/pull/210", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-01T00:22:07.000+0000", "updated": "2014-04-01T00:22:07.000+0000" }, { "id": "411530", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-13T20:59:40.000+0000", "updated": "2017-03-13T20:59:40.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }