I am looking for a solution to the following scenario:
I'd like to write a script that opens a new window with a specified link (ex: http://yadayada.org/customer#.pdf
). With the same function (or click) I'd like to to also open http://yadayada.org/customer#A.pdf
if it exists. Below I have a working sample of a function that works to open the files in 2 new windows. However, I obviously get a blank window if the second location doesn't exist. I'd like the second page to not be opened if the reference does not exist.
function OpenFile() {
win=window.open('http://yadayada.org/~(student_number).pdf', '_self');
win2=window.open('http:/yadayada.org/~(student_number)a.pdf', '_blank');
win.focus();
}
OpenFile();