hello!
well i have a function that recieves 3 parameters, the title -> Title, a file -> PGN and a name -> NAME
but i want to add a 4th parameter which is CONDITION.
now i want CONDITION to be the name of a text file, and in the new window the user to be able to click on a link and open the CONDITION file.
something like:
[CODE]function OpenWindow(TITLE,NAME,PGN)
{
var NewWindow=window.open(”,’name’,’height=660,width=650,status=1′);
NewWindow.document.write(‘<html><head><title>’ + TITLE + ‘</title>’);
NewWindow.document.write(‘</head><body background=”bakgrnd2.jpg”>’);
NewWindow.document.write(‘<script type=”text/javascript” src=”../../scripts/condiciones.js”></script>’);
NewWindow.document.write(‘<H2><FONT COLOR=”Maroon”>’ + NAME + ‘</FONT></H2>’);
NewWindow.document.write(‘<a href=”javascript:Condiciones(‘condicion.txt’)”>purefan</a>’);
NewWindow.document.write(‘<APPLET code=”ChessBoard.class” align=”baseline” width=”630″ height=”560″>’);
NewWindow.document.write(‘<PARAM name=pgngamefile value=’ + PGN + ‘>’);
NewWindow.document.write(‘</APPLET>’);
NewWindow.document.write(‘<br><a href=’ + PGN + ‘>download the PGN</a> ’);
NewWindow.document.write(‘<a href=”javascript:self.close()”>close this window</a></p>’);
NewWindow.document.write(‘</body></html>’);
NewWindow.document.close();
}
//–>
</script>
being condiciones.js:
[CODE]function Condiciones(FILE)
{
var VentanaCondicion = window.open(”,’name’,’height=440,width=900,status=1′);
VentanaCondicion.document.write(‘<html><frameset cols=”100%” border=”0″>’);
VentanaCondicion.document.write(‘<frame name=”left” src=” ‘ + FILE+ ‘” marginwidth=”0″ marginheight=”0″ scrolling=”auto” frameborder=”0″ noresize>’);
VentanaCondicion.document.write(‘</frameset><body>’);
VentanaCondicion.document.write(‘</body></html>’);
}
<!– this is the best way i could find to display the FILE file. i know its lame 🙁 –>
the problem surges in the line:
[code] NewWindow.document.write(‘<a href=”javascript:Condiciones(‘condicion.txt’)”>purefan</a>’);
Just to make things clear, i dont want to always display ‘condicion.txt’, this is the file i want to change with the paremeter CONDITION but for testing purposes i set the file as is.
back on track, for the displayed line, if i write:
[code] NewWindow.document.write(‘<a href=”javascript:Condiciones(‘condicion.txt’)”>purefan</a>’);
it says [B]object expected
[code] NewWindow.document.write(‘<a href=”javascript:Condiciones(“condicion.txt”)”>purefan</a>’);
it says [B]syntax error
as a final note:
i would like my function to be:
[code]
function OpenWindow(TITLE,NAME,PGN, CONDITION)
{
var NewWindow=window.open(”,’name’,’height=660,width=650,status=1′);
NewWindow.document.write(‘<html><head><title>’ + TITLE + ‘</title>’);
NewWindow.document.write(‘</head><body background=”bakgrnd2.jpg”>’);
NewWindow.document.write(‘<script type=”text/javascript” src=”../../scripts/condiciones.js”></script>’);
NewWindow.document.write(‘<H2><FONT COLOR=”Maroon”>’ + NAME + ‘</FONT></H2>’);
NewWindow.document.write(‘<a href=”javascript:Condiciones(‘ ‘ + CONDITION + ‘ ‘)”>purefan</a>’);
NewWindow.document.write(‘<APPLET code=”ChessBoard.class” align=”baseline” width=”630″ height=”560″>’);
NewWindow.document.write(‘<PARAM name=pgngamefile value=’ + PGN + ‘>’);
NewWindow.document.write(‘</APPLET>’);
NewWindow.document.write(‘<br><a href=’ + PGN + ‘>download the PGN</a> ’);
NewWindow.document.write(‘<a href=”javascript:self.close()”>close this window</a></p>’);
NewWindow.document.write(‘</body></html>’);
NewWindow.document.close();
}
//–>
</script>
or at least thats the idea.
I hope i explained myself right…im not sure i did :p
Anyways thanks for your time and all ?