<Manufacturers>
<Manufacturer name="abc">
<flags=""/>
</Manufacturer><Manufacturer name="abcd">
<flags=""/>
</Manufacturer>
<Manufacturer name="abcde">
<flags=""/>
</Manufacturer>
<Manufacturers>
I want to print out the names of just the manufacturers which contain the string 'bc' in the name
This is my attempt so far
$( "#autocomplete" ).on( "filterablebeforefilter", function ( e, data ) {
var $ul = $(this);
html = "";
$ul.html( "<li><div class='ui-loader'><span class='ui-icon ui-icon-loading'></span></div></li>" );
$ul.listview( "refresh" );
$.ajax({
type: "GET",
url: "./Sources.xml",
datatype: "xml",
error: function(jqXHR, textStatus, errorThrown) {
console.log('Error: ' + errorThrown);
},
success: function(xml.toLowerCase()) {
console.log('AJAX Request is succeded.');
$(xml).find('Manufacturer[name*="' + $(data.input).val() + '"]').each(function(){
console.log($(this).attr('name'));
});
$ul.html(html);
$ul.listview( "refresh" );
$ul.trigger( "updatelayout");
}
});
});
The problem is that .find() is case sensitive. How can I do the same but case insensitive