I'm developing a feature that allows users to add videos to playlists by clicking on a link in a popover. The challenge I'm facing is extracting the video_id and the selected playlist when the user interacts with the popover. Any tips on how to achieve this?
<script type="text/javascript">
$(document).ready(function() {
$("#muncher").click(function(event){
event.preventDefault();
$.ajax({
type:"POST",
url:"/edit_favorites/",
data: {
'video_add': $('#add').val(), // get video_id
'playlist_selected': $('#').val() // get chosen playlist
},
success: function(){
$('#muncher').html("Added");
}
});
return false;
});
});
</script>
<div id = 'muncher'>
<div id = 'add'>12345</div>
<a href = "#" id="munch" rel="popover" data-html="true" data-placement="right" data-content= "<a href= '#'>Favorites</a><br>
<a href = '#' class = 'Funny'>Funny</a><br>
<a href = '#' class = 'test'>test</a><br>
<a href = '#' class = 'test1'>test1</a><br>
" data-original-title="Add to your plate">
Munch
</a>
</div>