How can i save a div absolute position into a mysql table with js & php? thanks in advance
Apr 7th, 2008 23:32
ha mo, Jean-Bernard Valentaten, Facundo Pagani,
You will have to call a php-document to which you pass the left and
top coordinates via the querystring (alternatively you could use a
form that passes the coordinates via POST method).
function passCoords(x, y)
var myURL = 'http://www.mysite.com/myscript.php?left=' + x + 'top='
x = left;
y = top;
Well, that is just one possibility to do it and it won't get the
correct coordinates if the div is not positioned abolute.
If you have a relative positioned element (div, ...) I guess there is
no realistic way to do the job (well you could write a function that
iterates through the DOM-tree of your document, but that'll be a heck
load of work).