I have something like this coming as a JSON reponse:
<span id=\"my-id-527114\">Some data here</span>\n <span id="my-differentid">something else</span>
is there any way to get the text “Some data here”
Right now I am getting the text:
Here’s my function:
$( "#myelementid" ).autocomplete({
source: function( request, response ) {
$.ajax({
url: "some remote url",
dataType: "jsonp",
data: {
term: request.term
},
success: function( data ) {
response( $.map(data, function( item ) {
if(item.value != " ")
{
var lbl = $(item.label);
return {
label: $(lbl).text(),
value: item.id
}
}
}));
}
});
},
You response is not JSON. It’s HTML/String.