[TIMOB-5647] MobileWeb: Ti.Platform.canOpenURL method not returns false if URL is unavailable
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2011-06-02T23:22:53.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Backlog |
| Components | MobileWeb |
| Labels | n/a |
| Reporter | Misha Vasko |
| Assignee | Maxim Negadaylov |
| Created | 2011-06-01T05:24:24.000+0000 |
| Updated | 2017-03-04T00:10:21.000+0000 |
Description
Ti.Platform.canOpenURL method not returns false if URL is unavailable. When URL is available method returns true, if not browser generates an 404 error.
Returns true when URL = '\images', returns nothing and generates 404 error when URL = '\ima'. If URL='http://appcelerator.com' method returns true but when URL='http://google.com' it generates error:XMLHttpRequest cannot load http://google.com/. Origin http://html5 is not allowed by Access-Control-Allow-Origin.
var win = Ti.UI.currentWindow;
var ta = Ti.UI.createTextArea({
value: 'Please enter an url',
width: 200,
height: 100,
backgroundColor: '#FFF',
})
var but = Ti.UI.createButton({
title: 'check',
top: 110,
width: 100,
height: 45
});
win.add(but)
win.add(ta);
but.addEventListener('click', function(){
ta.value = Ti.Platform.canOpenURL(ta.value);
});
Closing ticket due to MobileWeb no longer being supported.