storing dom elements in a database

Joined: 11/28/2008

That sounds kinda weird. Let me see if I can say that better...

I want to be able to get a dom element from a webpage, store it in a database of some sort, and then later retrieve it and have it be a dom element again (AFAIK, you can't really store a dom element directly into an SQL db). Using javascript of course.

The only way I was able to come up with was to create an array of all elements on a page and use the array index as an identifier (stored in the db as and int)... but doing that just seems... querky.

Any one know of a better way? The only stuff on google and yahoo search that I was able to find was with doing it with Java... and I'm not even sure if that's what I wanted /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />

Oh, another thing. How hard is it to find a pixel cord relative to the element that was clicked on for clicks? (does that make any sense? /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> )

Thanks!

My blog about web development.
And my site about game development.

>>> math.sqrt(-1) == joey101
True

Joined: 11/28/2008
Hmm...Why not just save the

Hmm...Why not just save the ID of the element then grab it via javascript whenever you need to?

Why exactly are you wanting to do this?

Joined: 11/28/2008
I also have no idea what

I also have no idea what you're really talking about, nor the purpose of what you're trying to accomplish. You should let us in on what you're doing, maybe we can figure out an alternate solution /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Joined: 11/28/2008
Alright.I'm wanting to make

Alright.

I'm wanting to make an opensource traffic analysis software. First thing I want to implement is a heat map of user clicks on a webpage. Getting the ID wouldn't work because not all elements have ids.

Something like xpath looks like it would work (being able to easily reference any xml object) but it only works on FF and IE. Or would that not be that much of a problem? /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />

My blog about web development.
And my site about game development.

>>> math.sqrt(-1) == joey101
True

Joined: 11/28/2008
If it doesn't have an id, I

If it doesn't have an id, I would probably question why you are interested in whether it was clicked. You can give an id to most elements, and it is often worth giving it to links, tables, images, divs and lists, in addition to forms and form elements. What else would you be interested in? Limiting it to elements with id's will reduce the "noise".

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified