P
Pekka Karjalainen
Hi, this is my first posting here. I also have a question about etiquette.
There's a html file associated with my question. I cannot host it
indefinitely at the current location. I don't, however, want to reproduce
it here, since it is a little unwieldy for that.
So, is it poor etiquette to refer to external files in postings, since the
postings will be archived, but the external files are not permanent?
Should I find a permanent home for further files that I may need with
further questions?
Someone might find this posting from the archives in N years to come,
after all.
* * *
Now, on to my question!
I want to build a table that knows where it has been clicked. I found the
following solution myself. Are there better ones?
http://www.student.oulu.fi/~pkarjala/question1.html
(tested on Mozilla 1.7.8/Linux)
It sets the event handlers for each TD in the build() loop, including a
parameter in the function call that is different for each TD.
The whole thing is a simple example with a table with 5 by 5 cells. If you
click on a cell it's supposed to change color. Naturally, my question is
one more general terms. How to make big tables that associate various
event handlers with various cells, and where you will know exactly which
element triggered the event? How to make it simple and maintainable?
There's a html file associated with my question. I cannot host it
indefinitely at the current location. I don't, however, want to reproduce
it here, since it is a little unwieldy for that.
So, is it poor etiquette to refer to external files in postings, since the
postings will be archived, but the external files are not permanent?
Should I find a permanent home for further files that I may need with
further questions?
Someone might find this posting from the archives in N years to come,
after all.
* * *
Now, on to my question!
I want to build a table that knows where it has been clicked. I found the
following solution myself. Are there better ones?
http://www.student.oulu.fi/~pkarjala/question1.html
(tested on Mozilla 1.7.8/Linux)
It sets the event handlers for each TD in the build() loop, including a
parameter in the function call that is different for each TD.
The whole thing is a simple example with a table with 5 by 5 cells. If you
click on a cell it's supposed to change color. Naturally, my question is
one more general terms. How to make big tables that associate various
event handlers with various cells, and where you will know exactly which
element triggered the event? How to make it simple and maintainable?