[TIMOB-23219] Windows: Parity: Cannot set HTML property on a webview
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Duplicate |
| Resolution Date | 2016-04-16T15:09:10.000+0000 |
| Affected Version/s | Release 5.2.2 |
| Fix Version/s | n/a |
| Components | Windows |
| Labels | windows_phone |
| Reporter | Rene Pot |
| Assignee | Kota Iguchi |
| Created | 2016-04-15T13:44:26.000+0000 |
| Updated | 2017-03-21T23:14:12.000+0000 |
Description
When trying to set html or a local url to a webview in Windows Phone, it fails.
Example code:
$.webview.html = "<b>Test</b>"
Hello, This might help testing the issue. *app.js*
*local.html*var win = Ti.UI.createWindow(); var webview = Ti.UI.createWebView({ url: 'local.html' }); win.add(webview); win.open();*local.css**local.js*p { color: #880000; font-weight: bold; font-size: 24px; }Regards, Shariffunction addParagraphAlert() { document.getElementById('localtest').addEventListener('click', function(e) { alert('you clicked the paragraph'); }); }hi, thanks. But setting the local URL doesn't work either. (as per title of this ticket). It crashes too. (unknown error it says)
We've addressed the issue of not loading a local URL/HTML file in the related ticket I've linked: TIMOB-20143 I'm not sure if we also addressed setting HTML itself on the web view. Perhaps [~kota] knows..
[~topener] You should be able to workaround this in the meantime (hopefully), from Kota's comments on the related ticket:
var htmlPage = "/local.html"; if(OS_WINDOWS){ htmlPage = "ms-appx-web://" + htmlPage; } $.webview.url = htmlPage;This issue should be fixed by TIMOB-20143, which is scheduled to release in 5.3.0. Works for me on latest 5.3.0 nightly.
appc ti sdk install --branch 5_3_X 5.3.0.v20160415121959Duplicate of TIMOB-20143
Closing ticket as duplicate with reference to the above comments and links.