|No such thing as a small change|
Re: Webpage Element Informationby Your Mother (Bishop)
|on Nov 15, 2007 at 03:36 UTC||Need Help??|
So, this is a bit tougher than I thought but I'm only giving up early b/c I only had an hour to look at it. I believe the following approach will get you there if you're willing to bang on it and solve the click depth problem. The missing parts aren't hard I think, I just don't know them or have time to figure them out tonight.
First the JS.
So that buys you the info, something like this for anything clicked is sent up to our Perl script. Called "/cgi/position.pl" here.
The problem is two-fold. First it doesn't show which element was which in the lineage. This could be gotten via the jQuery but I can't sling a one liner with it so I left it out. :(
Second, clicks propagate to parents. If you click on a link it will also receive the click for the paragraph the link is in, the div the paragraph is in, the body the div is in, and the html the body is in. I don't know how to solve that but the jQuery list is very friendly, I'm sure someone does.
Then the Perl skeleton.
I left out the arg and file handling. They should be pretty trivial.
Sorry I couldn't bat out a closer to finished stub. Good luck.