Can anyone see the (obvious?) reason why I cant get Databinding to fill a table, all dynamically produced in a pop-up window using Javascript... I have double checked file-names & field names used, but the code does not seem to find the object defined for the databinding (I get no error messages with the object defined (as below) or with it removed completely! The code works in IE 6 as straight-forward HTML in its own page, but I obviously want it dynamic to fill the table with different data depending on the month selected by the user.
Heres the code I`m trying....appreciate any help here.
<HTML>
<HEAD>
<TITLE>Results Page</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
function maketable() {
resultsWindow.document.write("<DIV align=LEFT><TABLE ID=Data DATASRC=#results WIDTH=400 BGCOLOR='ffcc99' BORDER=4 CELLSPACING=2 CELLPADDING=2 ALIGN=LEFT>");
resultsWindow.document.write("<THEAD><TH> Date </TH> <TH> Destination </TH><TH> Angler </TH><TH> Catch </TH> <TH> Position </TH> <TH> Aggregate </TH></THEAD>");
resultsWindow.document.write("<TBODY><TR><TD ALIGN=CENTER><SPAN DATAFLD='Date'></SPAN></TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Destination'></SPAN> </TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Angler'></SPAN></TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Catch'></SPAN></TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Position'></SPAN></TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Aggregate'></SPAN></TD>");
resultsWindow.document.write("</TR></TBODY>");
resultsWindow.document.write("</TABLE></DIV>");
}
function closeWindow() {
if (resultsWindow && !resultsWindow.closed) {
resultsWindow.close()
}
}
function popup(datafile) {
var leftPos =10
// if (screen) leftPos = screen.width-440;
resultsWindow = window.open('', 'resultsWindow', 'width=440,height=500,left='+leftPos+',top=0,scrollbars = yes');
resultsWindow.focus();
resultsWindow.document.write("<HTML><HEAD><TITLE>Fishing Results</TITLE></HEAD><BODY>");
resultsWindow.document.write('<OBJECT ID="results" WIDTH=200 HEIGHT=300 CLASSID = "CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83">');
resultsWindow.document.write('<PARAM NAME="FieldDelim" VALUE=http://www.webdeveloper.com/forum/archive/index.php/",">');
resultsWindow.document.write('<PARAM NAME="DataURL" VALUE=http://www.webdeveloper.com/forum/archive/index.php/"Fishing2003.csv">');
resultsWindow.document.write('<PARAM NAME="UseHeader" VALUE=http://www.webdeveloper.com/forum/archive/index.php/True></OBJECT>');
resultsWindow.document.write("<CENTER><H2>The Angling Championships</H2></CENTER>");
maketable();
resultsWindow.document.write("</BODY></HTML>");
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR=WHITE>
<CENTER>
<H1>Fishing Results</H1>
<TABLE layout="fixed" BORDER="4" CELLSPACING="2" CELLPADDING="2" ALIGN="CENTER">
<TR>
<TH Width="300" colspan=6><B><FONT FACE="Comic Sans MS" COLOR="#330099">Select
from Archive:</FONT></B></TH>
</TR>
<TR>
<TD WIDTH="50"><FONT FACE="Comic Sans MS"><A HREF=http://www.webdeveloper.com/forum/archive/index.php/"javascriptopup('Jan2003')">Jan<BR> 2003</A></FONT></TD>
<TD WIDTH="50"><FONT FACE="Comic Sans MS"><A HREF=http://www.webdeveloper.com/forum/archive/index.php/"javascriptopup('Feb2003')">Feb<BR> 2003</A></FONT></TD>
<TD WIDTH="50"><FONT FACE="Comic Sans MS"><A HREF=http://www.webdeveloper.com/forum/archive/index.php/"javascriptopup('Mar2003')">Mar<BR> 2003</A></FONT></TD>
</TR></TABLE>
</CENTER>
</BODY>
</HTML>
Heres the code I`m trying....appreciate any help here.
<HTML>
<HEAD>
<TITLE>Results Page</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
function maketable() {
resultsWindow.document.write("<DIV align=LEFT><TABLE ID=Data DATASRC=#results WIDTH=400 BGCOLOR='ffcc99' BORDER=4 CELLSPACING=2 CELLPADDING=2 ALIGN=LEFT>");
resultsWindow.document.write("<THEAD><TH> Date </TH> <TH> Destination </TH><TH> Angler </TH><TH> Catch </TH> <TH> Position </TH> <TH> Aggregate </TH></THEAD>");
resultsWindow.document.write("<TBODY><TR><TD ALIGN=CENTER><SPAN DATAFLD='Date'></SPAN></TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Destination'></SPAN> </TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Angler'></SPAN></TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Catch'></SPAN></TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Position'></SPAN></TD>");
resultsWindow.document.write("<TD ALIGN=CENTER><SPAN DATAFLD='Aggregate'></SPAN></TD>");
resultsWindow.document.write("</TR></TBODY>");
resultsWindow.document.write("</TABLE></DIV>");
}
function closeWindow() {
if (resultsWindow && !resultsWindow.closed) {
resultsWindow.close()
}
}
function popup(datafile) {
var leftPos =10
// if (screen) leftPos = screen.width-440;
resultsWindow = window.open('', 'resultsWindow', 'width=440,height=500,left='+leftPos+',top=0,scrollbars = yes');
resultsWindow.focus();
resultsWindow.document.write("<HTML><HEAD><TITLE>Fishing Results</TITLE></HEAD><BODY>");
resultsWindow.document.write('<OBJECT ID="results" WIDTH=200 HEIGHT=300 CLASSID = "CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83">');
resultsWindow.document.write('<PARAM NAME="FieldDelim" VALUE=http://www.webdeveloper.com/forum/archive/index.php/",">');
resultsWindow.document.write('<PARAM NAME="DataURL" VALUE=http://www.webdeveloper.com/forum/archive/index.php/"Fishing2003.csv">');
resultsWindow.document.write('<PARAM NAME="UseHeader" VALUE=http://www.webdeveloper.com/forum/archive/index.php/True></OBJECT>');
resultsWindow.document.write("<CENTER><H2>The Angling Championships</H2></CENTER>");
maketable();
resultsWindow.document.write("</BODY></HTML>");
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR=WHITE>
<CENTER>
<H1>Fishing Results</H1>
<TABLE layout="fixed" BORDER="4" CELLSPACING="2" CELLPADDING="2" ALIGN="CENTER">
<TR>
<TH Width="300" colspan=6><B><FONT FACE="Comic Sans MS" COLOR="#330099">Select
from Archive:</FONT></B></TH>
</TR>
<TR>
<TD WIDTH="50"><FONT FACE="Comic Sans MS"><A HREF=http://www.webdeveloper.com/forum/archive/index.php/"javascriptopup('Jan2003')">Jan<BR> 2003</A></FONT></TD>
<TD WIDTH="50"><FONT FACE="Comic Sans MS"><A HREF=http://www.webdeveloper.com/forum/archive/index.php/"javascriptopup('Feb2003')">Feb<BR> 2003</A></FONT></TD>
<TD WIDTH="50"><FONT FACE="Comic Sans MS"><A HREF=http://www.webdeveloper.com/forum/archive/index.php/"javascriptopup('Mar2003')">Mar<BR> 2003</A></FONT></TD>
</TR></TABLE>
</CENTER>
</BODY>
</HTML>