I know very little Javascript -- most of my programming is done in Perl. Perhaps this is a simple question, but to me it's worth the points...:)
I have a JS function that is called when a user clicks on an object in a web page:
function makeWindow (title, caption, output, type) {
outputWindow=window.open("
","seqWind
ow","resiz
able=yes,m
enubar=yes
,toolbar=y
es,height=
300,width=
600,scroll
bars=yes,s
tatus=yes,
offscreenB
uffering=f
alse");
outputWindow.focus();
outputWindow.document.writ
e ('<HTML><HEAD><TITLE>' + title + '</TITLE>');
outputWindow.document.writ
e ('</HEAD>');
outputWindow.document.writ
e ('<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#551A8B" alink="#0000FF">');
outputWindow.document.writ
e ('<font face="Arial,Helvetica">' + caption + '</font><br>');
outputWindow.document.writ
e ('<font face="Arial,Helvetica">Dou
ble-click the sequence to select it.</font>');
outputWindow.status = 'Please wait...';
outputWindow.document.writ
e ('<FORM NAME="output">');
outputWindow.document.writ
e ('<br><TEXTAREA NAME="seq" ROWS="6" COLS="60" WRAP=SOFT>');
outputWindow.document.writ
e (output);
outputWindow.document.writ
e ('</TEXTAREA>');
outputWindow.document.writ
e ('</FORM>');
outputWindow.document.writ
e ('<FORM NAME="blastit" ACTION="
http://www.ncbi.nlm.nih.gov/blast/Blast.cgi" METHOD=POST>');
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=QUERY VALUE="' + output + '">');
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=CMD VALUE="Put">');
if (type == 'dna') {
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=PROGRAM VALUE="blastn">');
} else {
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=PROGRAM VALUE="blastp">');
}
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=DATABASE VALUE="nr">');
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=LAYOUT VALUE="TwoWindows">');
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=AUTO_FORMAT VALUE="Fullauto">');
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=SHOW_OVERVIEW VALUE="yes">');
outputWindow.document.writ
e ('<INPUT TYPE=hidden NAME=CDD_SEARCH VALUE="on">');
outputWindow.document.writ
e ('<INPUT TYPE="submit" VALUE="Blast" NAME="BlastButton">');
outputWindow.document.writ
e ('</FORM>');
outputWindow.document.writ
e ('</body></html>');
outputWindow.status = 'Done.';
outputWindow.document.clos
e();
}
This function creates a pop-up window that contains in a text box the sequence (either dna or protein) of the gene on which the user clicked (the sequence is contained in the variable called output), along with some identifying information and a button to submit the sequence to the BLAST server at the National Institutes of Health. As written above, it works fine, except that the NIH page loads in the original pop-up window when the user clicks the Blast button. How can I have clicking the Blast button create a new window which will contain the page from the NIH server?
Thanks for any help...
Mike
Start Free Trial