L
L
Lavrov952019-01-10 15:18:15
AJAX
Lavrov95, 2019-01-10 15:18:15

How can appendTo image be correct?

var image = $($.parseHTML('<img width="50" height="50" style="margin-left: 10px; margin-bottom: 8px">')).attr('src', event.target.result);
ar imageSortable = '<li class="ui-state-default">' + image + '</li>';
                    
imageSortable.appendTo(placeToInsertImagePreview);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ihor Bratukh, 2019-01-10
@BRAGA96

imagejQuery element, object. You are concatenating a string imageSortablewith an object. imageSortablestring and string does not have a appendTo.

var image = '<img src="'+ event.target.result +'" width="50" height="50" style="margin-left: 10px; margin-bottom: 8px">';
var imageSortable = '<li class="ui-state-default">' + image + '</li>';
placeToInsertImagePreview.append(imageSortable);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question