Get all matching results from XML file with jQuery on keyup?

If the xml file is static, I would begin by loading it only once when the page first loads so that it isn't called, downloaded, and parsed each time. I'm going to paste the whole chunk of javascript here, but the important bit is where I set $("#stuff"). Html('') which empties the contents of #stuff.

If the xml file is static, I would begin by loading it only once when the page first loads so that it isn't called, downloaded, and parsed each time. I'm going to paste the whole chunk of javascript here, but the important bit is where I set $("#stuff"). Html(''); which empties the contents of #stuff.

$(document). Ready(function() { var xml = ''; $. Ajax({ url: "file.

Xml", success: function(data) { xml = $(data) }, dataType: 'xml' }); var n_ime = new Array(); num_div = 0; $("#stuff, #stuff2").hide(); $('form input'). Keyup(function() { unos = $(this).val(); if (unos! = "") { $('#stuff').

Html(''); xml. Find('osoba'). Each(function() { ime = $(this).

Find('ime').text(); trazi = new RegExp(unos, "i"); if ((trazi. Test(ime)) == true) { prezime = $(this). Find('prezime').text(); adresa = $(this).

Find('adresa').text(); $("#stuff"). Append('Ime: ' + ime + '', 'Prezime: ' + prezime + '', 'Adresa: ' + adresa + ''); $("#stuff").dequeue(). FadeIn(500); }; }); } /* if (unos!

="") kraj uslova */ else { $("#stuff").dequeue(). Stop(true, true). FadeOut(500, function() { $("#stuff p").remove(); }); } }); }).

Thank you, that fixes it. – Mentalhead Sep 6 at 15:16.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions