Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5647] MobileWeb: Ti.Platform.canOpenURL method not returns false if URL is unavailable

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-06-02T23:22:53.000+0000
Affected Version/sn/a
Fix Version/sBacklog
ComponentsMobileWeb
Labelsn/a
ReporterMisha Vasko
AssigneeMaxim Negadaylov
Created2011-06-01T05:24:24.000+0000
Updated2017-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);
});

Comments

  1. Lee Morris 2017-03-04

    Closing ticket due to MobileWeb no longer being supported.

JSON Source