Javaxcript question for Dreamweaver
by Reywob(at)aol.com
|
Date: |
Tue, 25 Jul 2000 13:05:13 EDT |
To: |
hwg-techniques(at)hwg.org |
|
todo: View
Thread,
Original
|
|
Hi,
Can anyone help me with the following javascript? (Full code at the end of
this email)
exportData=exportData.substring(0,exportData.length-1)+lineBreak;
I'm trying to write something in front of the string but cannot. I can write
after the string:
exportData=exportData.substring(0,exportData.length-1)+"HELLO
WORLD"+lineBreak;
How can I write in front????
TIA
Peter.
======FULL CODE======
//function: exportTable
//description: called from Export button
//exports tabular table based on html table
function exportTable(){
var exportData = "";
var theForm = document.forms[0];
var currTable = findTable();
var lineBreak = getLineBreak(theForm);
var delimiter = getDelimiter(theForm);
var tableRows = currTable.childNodes;
var nRows = tableRows.length;
var i,j;
var tableCells;
var nCells;
var currRow;
for (i=0;i<nRows;i++){
if (tableRows.item(i).tagName!="TR")
continue;
currRow = tableRows.item(i);
tableCells = currRow.childNodes;
nCells = tableCells.length;
for (j=0;j<nCells;j++){
exportData+=addQualifiers( getTextNode(tableCells.item(j)),
delimiter);
exportData+=delimiter;
}
exportData=exportData.substring(0,exportData.length-1)+"\'\);"+lineBreak;
}
writeToFile(exportData);
}
========END OF CODE========
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA