Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5642] MobileWeb: stopLoading method in webView works incorrect

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-06-07T23:18:21.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-41
ComponentsMobileWeb
Labelsn/a
ReporterMisha Vasko
AssigneeMaxim Negadaylov
Created2011-06-07T03:29:18.000+0000
Updated2017-03-04T00:10:13.000+0000

Description

Method stopLoading closes the loaded pages of the webView instead of stopping loading an opening in the current moment page. If there is no loaded pages in the webView the stopLoading method closes the working window.
var win = Ti.UI.currentWindow;

var tf = Ti.UI.createTextField({
	left: 10,
	top: 5,
	width: 320,
	height: 40
});

var webView = Ti.UI.createWebView({
	top: 50,
	left: 10,
	width: 250,
	height: 300,
//	url: 'google.com/404',
	backgroundColor: 'red',
	loading: false,
	touchEnabled: false,
	
});

var but = Ti.UI.createButton({
	left: 400,
	top: 10,
	title: 'stop loading',
	width: 200,
	height: 50
})
win.add(but);
win.add(tf);
win.add(webView);

but.addEventListener('click',function(){
	webView.stopLoading();
});

tf.addEventListener('return',function(){
	webView.url = tf.value;

	});

webView.addEventListener('beforeload', function(){
	alert('Page loading begins');
});

webView.addEventListener('load',function(){
	alert('Page loaded');
});

webView.addEventListener('error',function(){
	alert('page cannot be load');
});

win.addEventListener('click', function(){
//	webView.stopLoading();
	Ti.UI.backgroundColor = '#080';
});

Comments

  1. Lee Morris 2017-03-04

    Closing ticket due to MobileWeb no longer being supported.

JSON Source