{ "id": "62090", "key": "TIMOB-1458", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2012-06-22T16:24:23.000+0000", "created": "2011-04-15T02:53:24.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "17952", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "86938", "key": "TIMOB-8293", "fields": { "summary": "iOS: Subsequently setting the html property of a webview does not show the changed html but shows blank content", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T21:29:42.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

If I add a local string to the html-attribute and try to get the\nstring back, I'll only get an empty html tag.

\n
\nvar html = '<html><body>Text</body></html>';\nvar view = Titanium.UI.createWebView();\nview.html = html;\nalert(view.html);\n
{html}", "attachment": [], "flagged": false, "summary": "WebView doesn't keep html", "creator": { "name": "wolef", "key": "wolef", "displayName": "wolef", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "wolef", "key": "wolef", "displayName": "wolef", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "134676", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "That code sample still will not work, but for a good reason. Setting the html is an async process, so it returns quickly. In the background, the web view is loading up your HTML and rendering it. When you inspect the html property right away, it will be whatever the web view had in it before you set the html property. In this case, it will be something like \"\".\n\nIf you listen for the \"load\" event, you'll see your HTML returned. I expanded your example to show how to properly handle this:\n\n{code:title=app.js}\n\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\nvar html = 'Text';\nvar web = Ti.UI.createWebView({\n html: html,\n width: '90%', height: '90%', top: '5%', left: '5%'\n});\nwin.add(web);\nwin.open();\nweb.addEventListener('load', function() {\n if (web.html != html) {\n win.backgroundColor = '#f00';\n alert('FAIL: web.html != original html');\n }\n else {\n win.backgroundColor = '#0f0';\n alert('PASS: I love you forever!');\n }\n Ti.API.info(web.html);\n});\n{code}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-06-01T15:31:33.000+0000", "updated": "2011-06-01T15:31:33.000+0000" }, { "id": "199847", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Dup of TIMOB-8293 ", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-06-22T16:24:23.000+0000", "updated": "2012-06-22T16:24:23.000+0000" }, { "id": "410586", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T21:29:42.000+0000", "updated": "2017-03-09T21:29:42.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }