[TIMOB-5642] MobileWeb: stopLoading method in webView works incorrect
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-07T23:18:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2011-41 |
Components | MobileWeb |
Labels | n/a |
Reporter | Misha Vasko |
Assignee | Maxim Negadaylov |
Created | 2011-06-07T03:29:18.000+0000 |
Updated | 2017-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';
});
Closing ticket due to MobileWeb no longer being supported.