I'm a beginner so I know this is probably very basic but I just can't seam to figure it out. I'm writing a greasemonkey script to auto open a few links from a page . What i would like to do is if link1 is open do one thing and if link2 is opened do something different, but since the links are var's im not sure how to call the different functions to the different windows. Here is how im opening the windows
var link1= $(' a:eq(1)').attr('href');
var link2= $(' a:eq(3)').attr('href');
var site1= window.open(link1);
var site2= window.open(link2);
Is there a way to call the different functions by the variable name like
$(site1).ready(function() { //do this //});
$(site2).ready(function() { //do something else //});