Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/08/2009, 18:03
iovan
 
Fecha de Ingreso: septiembre-2007
Ubicación: PyRoot
Mensajes: 1.515
Antigüedad: 16 años, 7 meses
Puntos: 188
Guardar en DB con Ajax

Hola amigos, veran estoy usando un script en ajax que me permite hacer esto:

http://digitalhymn.com/argilla/tipmage/


En una parte del código dice esto:

Código js:
Ver original
  1. /**
  2.      *  It can be used to save the tooltip in a database with AjAX.
  3.      *  @param  identifier  An identifier (ID) that may be useful for a database
  4.      *  @param  posx    X coordinate of the tooltip rectangle after editing
  5.      *  @param  posy        Y coordinate of the tooltip rectangle after editing
  6.      *  @param  width   Width of the tooltip rectangle after editing
  7.      *  @param  height  Height of the tooltip rectangle after editing
  8.      *  @param  text        Text contained in the tooltip after editing
  9.      */
  10.     'onInsert' : function (identifier,posx,posy,width,height,text) {
  11.         // do nothing - this is just a stub
  12.     },

Me pueden ayudar a entender como puedo guardar en la DB la "etiqueta" (la posicion en X, la posicion en Y, etc... de la imagen,

Muchas gracias

EDITO:

COMO MAYOR REFERENCIA ECONTRE ESTO:

[hr]
Advanced operations

Tipmage provides tools to create and edit tooltips, but they would be pretty useless without a way to give them persistence (for example saving them in a database). To gain persistence we will use callback functions.

Tipmage provides 3 function stubs: onInsert, onUpdate and onDelete. These functions will be called automatically by the engine with the right parameters, which are: ID of the tooltip, horizontal and vertical position of the rectangle, width and height of the rectangle and the text attached to the tooltip.

By implementing the stubs, we can make Tipmage do what we want with our data.

Let's see an example illustrating how to implement the onInsert function. This code should go in the same place as the code showed above.
Código js:
Ver original
  1. <script type="text/javascript">
  2.   tipmage.onInsert = function (identifier,posx,posy,width,height,text) {
  3.     // do something, like an AJaX call or whatever...
  4.   };
  5. </script>

onInsert is called when a new tooltip is added, onUpdate is called when an existing tooltip is modified, onDelete is called when an existing tooltip is deleted.

__________________

Si entiendo el ingles, pero no se nada sobre como agregar a la DB con Ajax, muchas gracias.
__________________
Si quieres agradecer el triangulo obscuro de la parte derecha debes presionar +.