Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5556] MobileWeb: webView.html works incorrect

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-06-10T05:32:36.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMobileWeb
Labelsn/a
ReporterMisha Vasko
AssigneeMaxim Negadaylov
Created2011-06-10T03:12:01.000+0000
Updated2017-03-09T19:48:33.000+0000

Description

webView.html property is undefined in console while running test. When changing webView.html property the content of the webView changes but webView.html is still undefined.
var win = Titanium.UI.currentWindow;
win.backgroundColor = '#fff';

var webView1 = Ti.UI.createWebView({
	height:100,
	width:300,
	top:10,
	left:10,
	backgroundColor:'#336699',
	borderRadius:10,
	html:'<div style="color:#fff">I am a web view with in-line HTML</div>'
});

Ti.UI.currentWindow.add(webView1)

var changeHTML = Ti.UI.createButton({
	title:'Change HTML',
	height:40,
	left:10,
	top:120,
	width:300,
	font:{fontSize:20}
});
Ti.UI.currentWindow.add(changeHTML);
	
changeHTML.addEventListener('click', function(){
	webView1.html = '<h1>Title H1</h1><div style="color:#fff">Changed</div>';
	alert('it worked ' + webView1.html)
});

var remoteURL = Ti.UI.createButton({
	title:'Remote URL',
	height:40,
	left:10,
	top:170,
	width:300,
	font:{fontSize:20}
});
Ti.UI.currentWindow.add(remoteURL);
	
remoteURL.addEventListener('click', function(){
	var webView2 = Ti.UI.createWebView({
		height:100,
		width:300,
		top:10,
		left:10,
		backgroundColor:'#336699',
		borderRadius:10,
		url:'/examples/window.html'
		
	});
	Ti.UI.currentWindow.add(webView2);

});

var close = Ti.UI.createButton({
	title:'Close',
	height:40,
	top:220,
	left:10,
	width:300,
	font:{fontSize:20}
});
Ti.UI.currentWindow.add(close);
	
close.addEventListener('click', function(){
	Ti.UI.currentWindow.close();
});

Comments

  1. Lee Morris 2017-03-09

    Closing ticket as fixed.

JSON Source