With the help of a jQuery plugin, users can add tags. When a tag is clicked, I extract the tagLabel and search for a URL. If a URL is found, I open the link externally. The link is appended to my existing application like this:
localhost/App1/www.cnn.com
It should actually be
www.cnn.com
$('#myTags').tagit({
select: true,
sortable: true,
editable: true,
allowSpaces: true,
triggerKeys: ['enter', 'comma', 'tab'],
onTagClicked: function (evt, ui) {
var tagy = ui.tagLabel;
var result = URI.withinString(ui.tagLabel, function (url) {
var URL = url;
window.open(url, '_new');
});
}
});