I’m fairly new to AJAX, so I was having a little trouble getting started.
Basically, I want to make an AJAX request using the GET option and have a URL such as admin/something.php?id=1&that=33 be sent to the backend which will perform my PHP functions.
How am I going to generate my data using attr like $(this).attr('id') which is basically just grabbing DIV.ID information and such?
EDIT:
How could I integrate it into this sortable function?
$( ".heriyah" ).sortable({
handle : '.handle',
connectWith: ".heriyah",
revert: "invalid",
update: function(event, ui){
if(($(ui.sender).attr('id') == undefined)&&($(this).attr('id') == ui.item.parent().attr('id'))){
alert('UPDATE ' + $(this).attr('id') + ' ' + (ui.item.index()+1) + ' ' + $(ui.item).text());
}
},
Use jquery to generate ajax request. See documentation here.
Example code might look like this: