[TIMOB-5512] MobileWeb: webView.url does not open local URLs in correct format
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-10T04:39:17.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | n/a |
Reporter | Misha Vasko |
Assignee | Maxim Negadaylov |
Created | 2011-06-10T04:00:27.000+0000 |
Updated | 2017-03-09T20:40:59.000+0000 |
Description
webView does not open local URLs when webView.url == '/examples/window.html'. It will open it if webView.url == 'http://localhost/examples/window.html'.
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();
});
Closing ticket as fixed.