I have an XML file which is structured as follows:
place1
location1
place2
location2
place3
location3
These rows go up to 5000. Now I've got a JavaScript function which searches through the file, and based on what the user types returns the value from the XML file. At the moment it only searches through the store field and returns a value/series of values. How can I get it to search and then display both? So for example if I searched "location3" it would return both the store (in the example above this is 'place3') and also return the location (i.e. 'location3')?
So far I have 2 un-finished solutions:
1)I have managed to do this in JQuery like so:
$(document).ready(function(){
$.ajax({
type: "GET",
url: "index.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('Row').each(function(){
var store = $(this).find('store').text();
var location = $(this).find('location').text();
$('
').html('
Store: '+store+'
Location: '+location+'
').appendTo('#page-wrap');
});
}
});
});
but it doesn't work in IE6. Also, the above code just returns all the values whereas I need it to return values based on user input.
2)I have also done this in JavaScript, which I have pasted here. In this example I can return a result but it only searches the "store"!
As a MAJOR hurdle I need to support IE6 :/
Any help would be much appreciated.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)