[Answered ]-Django/Ajax Get "data" returning html from firing page instead of target view

1👍

#currentNodes is an a element. It doesn’t have a target attribute; it has an href.

url: $('#currentNodes').attr('href'),

1👍

The attribute target is not defined. try this:

$.ajax({
    url: $('#currentNodes').attr('href'),
    type: 'get',
    dataType: "html",
    success: function(data) {
        console.log(data);
    },
    failure: function(data) { 
        alert('error');
    }
}); 
👤Veas

Leave a comment