I did some more tests and found that:
wdoc=w.document;alert(wdoc.location.href);alert(wdoc.location.href);
would first display 'undefined' but the second alert would display the proper url (of the new window) FROM the original window. So I did a few more tests and have come to the conclusion that my attempts from last night were failing simply due to the fact that the window needs to load before calling the functions.
So now I have:
javascript:(function(){
w=window.open(B1,"CatchyPageTitleThatDoesn'tAppear");
setTimeout("otherFunction();",750);})();
function otherFunction(){
wdoc=w.document;thisDoc=document;
wdoc.setVariablesInTheFormInTheNewWindow;wdoc.forms[0].submit();}
which works! woohoo!
And now I move on to what, for me, is the really hard part. I would like to pull additional data from URL1, put it into an array and then use that array to set the values in the form on URL2. I should qualify that. Arrays, data, forms, easy. I'm not sure how exactly to go about pulling the data. It looks sort of like this:
tbody class="first of two appearances">
tr>
td> /td>
td> img /> /td> td> img /> /td> td> img /> /td> td> img /> /td> td> img /> /td> td> img /> /td> td> img /> /td> td> img /> /td> td> img /> /td> td> img /> /td> td> img /> /td> /tr> tr>
th>specific text /th> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> /tr> tr> th>
other specific text /th> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> td># /td> /tr> /tbody>
So, I know (maybe?) that I can use something like
uglyText = wdoc.getElementsByClass("first of two appearances")[0].innerHTML;
to get get that mess of data into a string, but am not sure how to proceed from there. I understand the concept of regular expressions and assume that something like that might work here, but have never successfully written one myself. Also, sometimes there are 10 data points and other times there are 11, if that matters.
At this point I only care about the #s from specific_text to other_specific_text. So any simple suggestion that will lead me to a solution that grabs them in order will make my day.
Thanks again for the help.