I created several buttons which share the same class .custom_button. Clicking the button will popup a new window to show some data. The problem is that all these buttons are linked to the same window even I assign different target url for each button. For example, there 3 buttons {A, B, C}, clicking A creates a window X with url localhost:8080/button/a. If I click B, the data will be sent to the window X with url localhost:8080/button/b. However, what I want is to display the result of B in another window Y. Here is my js code. Could anyone help on this?
$(document).ready(function(){
$(".custom_button").on( {
mousedown: function (event) {
if( event.which <= 2 ) {
var button_id = this.id,
button_href_id = "#" + button_id + "-href";
event.preventDefault();
window.open($(button_href_id).attr("href"), "popupWindow", "width=1400,height=900,scrollbars=yes");
}
}
});
});