I read somewhere that you don't need a form or hidden value to pass data when using ajax. If I could even get an example I would be grateful.
index.js:
function collectData(r) {
//gets the rows index
var i = r.parentNode.parentNode.rowIndex;
//selects the row picked
var sliceRow = document.getElementById('Sona').rows[i];
//have access to indiviual cells in the row
var sliceCell = sliceRow.cells;
var song = (sliceCell[0].innerHTML);
var artist = (sliceCell[1].innerHTML);
$.post("myLibrary.php", { postsong: song, postartist: artist });
}
PHP file :
if (isset($_POST)) {
$song = $_POST['postsong'];
echo $song;
}