testapi.js
/*
Function that search a video by title in a specific library
 */
Function that search a video by title in a specific library
Function that search a video by title in a specific library
function search_video() {
    $("#search_result").empty();
    let username = $("#select_users").val();
    let title = $("#search_video").val();
    console.log(title);
    $.ajax({
        type: 'GET',
        url: './library.php',
        data: {
            username: username,
            title: title,
        },
        success: function (response){
            console.log(response);
            let searchResult = $("#search_result");
            searchResult.append("<p> Video Found !</p>");
            searchResult.append("<a href=\"https://www.youtube.com/watch?v=" + response.id +"\" target=\"_blank\">"+ response.title);
            searchResult.append("")
        },
        error: function(xhr, status, error) {
            alert(error);
        }
    })
}
function search_video ( ) { $ ( "#search_result" ) . empty ( ) ; let username = $ ( "#select_users" ) . val ( ) ; let title = $ ( "#search_video" ) . val ( ) ; console . log ( title ) ; $ . ajax ( { type : 'GET' , url : './library.php' , data : { username : username , title : title , } , success : function ( response ) { console . log ( response ) ; let searchResult = $ ( "#search_result" ) ; searchResult . append ( "<p> Video Found !</p>" ) ; searchResult . append ( "<a href=\"https://www.youtube.com/watch?v=" + response . id + "\" target=\"_blank\">" + response . title ) ; searchResult . append ( "" ) } , error : function ( xhr , status , error ) { alert ( error ) ; } } ) }
Function that search a video by title in a specific library
Function that search a video by title in a specific library