Jump to content

Making Ajax Request


bravo14

Recommended Posts

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

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.