i have a build a javascript which does following:
Get content via ajax->php->sql and show it on index.php
after clicking the content there will be shown new content.
Now I want to have a function which sends data after content is clicked to a php which will do something in in the db. How can i create a function which will send data? Thank you!
This is my code which shows content:
<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>');
}
});
});
}
`
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…