Just a heads up, I understand why there would be rules against allowing this to function as it would be assumed to, due to the ramifications of someone opening a ton of spam pop-up windows, however, I’m wondering if it is at all possible to make it work.
Here’s my code;
$(document).ready( function() {
("a.explode").load(
function() { var url = $(this).attr("href");
window.open(url); }
);
});
and
<a class="explode" href="http://www.google.com">Link1</a>
<a class="explode" href="http://www.yahoo.com">Link2</a>
<a class="explode" href="http://www.tumblr.com">Link3</a>
For those who don’t understand what I’m trying to do, on page load, several windows are opened, using the href="" attribute of <a class="explode">.
POST EXPERIMENTATION EDIT: After working through this with a lovely member of SO, we figured out that this is not worth implementing/impossible (due to pop-up blockers most browsers natively have). window.open() must be bound to a .click() event, in effect making the concept useless.
You are missing
$in the code while selecting anchors. Useeachblock andhrefproperty of anchor like this