jquery does not work

0
/* EXCLUIR ARQUIVOS DA GALARIA */
$(document).ready(function() {

    /* EXCLUI ARQUIVOS DA GALERIA IMG E PDF */  
    $( "#btnexcluipdf" ).bind( "click", function() {

        var vID = $('#idarquivopdf').val();
        //alert(vID);

        //$("#status").html(
        //          "ID excluido: ");

        var vurl = '?pg=excluirarquivo';             
        var vData = {id:vID};       
        $.ajax(
            vurl 
            ,vData
            ,function(response,status){
                if(status == "sucess")
                {
                    var obj = jQuery.parseJSON(response);

                    $("#status").html(
                    "ID excluido: " + obj.id );

                }   
            }
        );
    });

o php ...

I left the code like this.

/ * EXCLUDING ARCHIVES FROM GALARIA * / $ (document) .ready (function () {

/* EXCLUI ARQUIVOS DA GALERIA IMG E PDF */  
$( "#btnexcluipdf" ).bind( "click", function() {

    $.ajax({
        method: "POST"
        ,url: document.location.pathname + '?pg=excluirarquivo'
        ,data: { id: $('#idarquivopdf').val() }
        ,dataType: "html"           
    })
    .done(function( resposta ) {
        alert(resposta);
    }).fail(function(jqXHR, textStatus) {
        alert("Erro:" + textStatus);
    }).always(function() {
        alert("OK");
    });



});

When clicking, the event (alert);) shows an html page, then it passes through done and does not show anything, but it finishes at OK.

    
asked by anonymous 18.02.2018 / 05:31

0 answers