Reputation: 720
I have an application where I want a button to open three different calendars in separate windows. The button has an action which references he following JS function:
function all_calendars() {
var target = "www.calendar_a.com";
var title = "Calendar A";
window.open(target, title, '_new');
var target = "www.calendar_b.com";
var title = "Calendar B";
window.open(target, title, '_new');
var target = "www.calendar_c.com";
var title = "Calendar C";
window.open(target, title, '_new');
}
Only the third calendar opens and in a new tab. I would prefer three windows, though I gather that is a browser setting, but why does only one of them open?
Upvotes: 1
Views: 81
Reputation: 7579
MDC states in its documentation about open method
The name should not contain any blank space
Hence, you're opening all in the same "Calendar" window.
Upvotes: 1