testapi.js
/*
Function adding a video to an user library, it will add the video to the selected user
It take 2 other arguments, one for the video title
the other for the youtube video ID
 */
Function adding a video to an user library, it will add the video to the selected user
It take 2 other arguments, one for the video title
the other for the youtube video ID
Function adding a video to an user library it will add the video to the selected user It take 2 other arguments one for the video title the other for the youtube video ID
function add_video() {
    let username = $("#select_users").val();
    let title = $("#video_title").val();
    let video_id = $("#video_id").val();
    console.log(username);
    $.ajax({
        method: 'PUT',
        data: {
            username: username,
            v: video_id,
            title: title,
        },
        url:'./library.php',
        success: function (response) {
            console.log(response);
            show_user();
        },
        error: function(xhr, status, error) {
            alert(error);
        }
    })
}
function add_video ( ) { let username = $ ( "#select_users" ) . val ( ) ; let title = $ ( "#video_title" ) . val ( ) ; let video_id = $ ( "#video_id" ) . val ( ) ; console . log ( username ) ; $ . ajax ( { method : 'PUT' , data : { username : username , v : video_id , title : title , } , url : './library.php' , success : function ( response ) { console . log ( response ) ; show_user ( ) ; } , error : function ( xhr , status , error ) { alert ( error ) ; } } ) }
Function adding a video to an user library, it will add the video to the selected user
It take 2 other arguments, one for the video title
the other for the youtube video ID
Function adding a video to an user library it will add the video to the selected user It take 2 other arguments one for the video title the other for the youtube video ID