jTag plugin Basic demo

Back to demo list

This demo will show you how to use the save & the delete callback
Those two callbacks will enable you to do some ajax magic on those two events to save the tags in your db.
To save tags in your db you will need those fields

$("#img1").tag({
	save: function(width,height,top_pos,left,label,the_tag){
		alert('I can save this tag ('+width+','+height+','+top_pos+','+left+','+label+')');
		/* once the ajax is done I need to get the ID here and then set it on the tag */
		the_tag.setId('someIdFromMyDb');
	},
	remove: function(id){
		alert('Here I can do some ajax to delete tag #'+id+' in my db');
	}
});

for more info be sure to checkout the db example directory.