Monday, December 18, 2006

[nw04s] javascript : example after page load


if you want to run some function after page load , just insert function between and <>
=====================
function s( ) {
t = document.getElementById('ANALYSIS_ITEM_1_interactive_0');
i = document.getElementById('imgdummy');
s = t.getElementsByTagName("table");
t1 = document.getElementById('ANALYSIS_ITEM_2_interactive_0');
s1 = t1.getElementsByTagName("table");
w = s1[0].rows[0].cells[0].clientWidth - 2;
text = '';
text2 = '';
s[0].rows[0].cells[1].innerHTML = text;
i.innerHTML = text2
alert(i.innerHTML);
}

================
function s( ) {

t = document.getElementById('ANALYSIS_ITEM_1_interactive_0');
s = t.getElementsByTagName("table");
t1 = document.getElementById('ANALYSIS_ITEM_2_interactive_0');
s1 = t1.getElementsByTagName("table");
alert(s1[0].rows[0].cells[0].innerTEXT);
s1[0].rows[0].cells[0].innerText = '總計';
text = '
' + s[0].innerHTML + s1[0].innerHTML + '
';
document.write(text);


}