How to do: button click opens in this tab, or modifier-click opens in new tab, as with a normal link
This is what I have currently:
$('#dialog').dial开发者_StackOverflow中文版og({autoOpen: false, buttons: [{
text: 'View Here', click: function() {
$(this).dialog('close');
window.location.hash = $(this).attr('tag');
}
}, {
text: 'View Original',
click: function() {window.location = $(this).attr('href');}
}
]});
If you click "View Original", the site loads directly. I want the user to be able to use the regular Command- or Ctrl-click to open the link in a new tab. How can I do this?
seems like this works,
$('#dialog').dialog({buttons: [{
text: 'View Here', click: function() {
$(this).dialog('close');
window.location.hash = $(this).attr('tag');
}
}, {
html: '<a href="http://google.com">View Original</a>',
click: function() {}
}
]});
demo
well, only on Chrome.....
精彩评论