bravo14 Posted June 25, 2011 Share Posted June 25, 2011 Hi I am using the code below to 'tag' an image in afacebook style,but I also want to add the tag details to a db $("#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'); } }); Where it says alert('I can save this tag ('+width+','+height+','+top_pos+','+left+','+label+')'); and the_tag.setId('someIdFromMyDb'); I have the php page to add the tags to the database. <?php include('includes/connect_inc.php'); $lot_id=$_SESSION['lot_id']; $top=$_GET['top_pos']; $left=$_GET['left']; $label=$_GET['label']; $add_tag=("INSERT into `tbl_tags` (`lot_id`,`top`,`left`,`width`,`height`,`description`) VALUES ('$lot_id','$top','$left','100','100','$label')"); ?> I am just unsure as to how to send the request and get the details back of the tags Any help would be much apperciated Quote Link to comment https://forums.phpfreaks.com/topic/240366-making-ajax-request/ Share on other sites More sharing options...
gizmola Posted June 28, 2011 Share Posted June 28, 2011 Look at the jquery manual here: http://api.jquery.com/jQuery.get As noted, post is a shorthand for the generic ajax function. Quote Link to comment https://forums.phpfreaks.com/topic/240366-making-ajax-request/#findComment-1236101 Share on other sites More sharing options...
Adam Posted June 29, 2011 Share Posted June 29, 2011 Is "tag" a plug-in? It's certainly not standard jQuery. Quote Link to comment https://forums.phpfreaks.com/topic/240366-making-ajax-request/#findComment-1236194 Share on other sites More sharing options...
bravo14 Posted June 29, 2011 Author Share Posted June 29, 2011 I found the tutorial/plugin here http://djpate.com/2011/01/14/jtag-a-jquery-plugin-to-tag-pictures-more/ Quote Link to comment https://forums.phpfreaks.com/topic/240366-making-ajax-request/#findComment-1236195 Share on other sites More sharing options...
Adam Posted June 29, 2011 Share Posted June 29, 2011 I've never heard of it before. Unfortunately I'm not going to sit down and learn how it works for free, as I'm sure most people here will take the same view. You would most certainly get the solution posting in the freelance board though.. Quote Link to comment https://forums.phpfreaks.com/topic/240366-making-ajax-request/#findComment-1236466 Share on other sites More sharing options...
bravo14 Posted July 6, 2011 Author Share Posted July 6, 2011 Do any of you know of any standard jquery plug-ins that allow for 'photo-tagging' and adding the values to a database? Quote Link to comment https://forums.phpfreaks.com/topic/240366-making-ajax-request/#findComment-1239050 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.