I have a javascript assembly that does the following: Get the content via ajax-> php-> sql and show it on index.php after clicking on the content, new content will appear.
Now I want to have a function that sends data after the content is clicked on php, which will do something in db. How can I create a function that will send data? Thanks!
This is my code that shows the contents:
<script id="source" language="javascript" type="text/javascript">
function laden(){
$(function()
{
$.ajax({
`usr_id`
url: 'content/get.php',
dataType: 'json',
success: function(data)
{
var id = data[0];
var name = data[1];
var count = data[3];
$('#output').html('<div onclick="laden('+id+')" id="content"></div>');
}
});
}); } `
source
share