This code is in visualforce (salesforce's page editor language). Basically the apex:repeat tags function as a sort of loop, generating a set of urls from outputlink. All these urls have a class of "name".
What the jquery is to do is find all the urls with the class name, and click them so they open in new windows. Its not working.
<apex:page standardcontroller="Account" extensions="maininvoice">
<apex:repeat value="{!theListOfIDs}" var="anId">
<apex:outputLink target="_blank" value="{!URLFOR($Page.invoice2,anId)}" styleClass="name" />
</apex:repeat>
<apex:includeScript value="{!URLFOR($Resource.jquery, 'js/jquery-1.4.2.min.js')}"/>
<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(document).ready(function(){
$('.name').click();
alert("debug");
}
);
</script>
</apex:page>