Search XML Data File with Jquery and Ajax Call

Searching XML data file with JQuery and Ajax call:

   
            $("#inpButton").click(function () {
                $("#pararesults ul").html("");
            var myloc = $("#inpSearch").val();
            var tmpSubject, tmpDate, tmpThumb;
            $.ajax({
                url: 'YOUR-DATA-FILE.xml',
                type: 'GET',
                dataType: 'xml',
                success: function (xml) {
                    $('url', xml).each(function () {
                        tmpGer = $('ger', this).text();
                        tmpEng = $('eng', this).text();
                        /* looks for exact match: */
                        if (tmpGer === myloc) {
     /* looks for partial match: 
     if (tmpGer.indexOf($('#inpSearch').val()) != -1) */                          
                            $("
  • ").html(tmpEng).appendTo("#pararesults ul"); } }) } }); }); /* And here are the HTML elements:*/

      The code snippet formatting uses SyntaxHighlighter