Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript Parsing error

    Greetings! I am having an issue with some Javascript that is used in a client side application with html forms displaying content from XML. The only way I know how to output the XML is by doing an alert(), so if there's another way that I can output the data please let me know.
    The error I am getting is Expected token 'eof' found 'NAME' when it runs through this function.

    Code:
    function GetKeyInfo0()
    {	test = getJobsXml();
    	alert(test);
    	
    oXmlJobs.XMLDocument.loadXML(getJobsXml());
    oJobs = oXmlJobs.XMLDocument.selectNodes("/jobs/job");
    for (var i = 0; i < oJobs.length; ++i)
    	{
    		var jobID
    		oXmlJobs.XMLDocument.loadXML(oJobs[i].xml)
    		jobID = oXmlJobs.XMLDocument.selectSingleNode('/job/field pos = "53"').text;
    		alert(jobID)
    	}
    	
    }
    any help or pointers is appreciated!
    Thanks!

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,028
    Thanks
    75
    Thanked 4,325 Times in 4,291 Posts
    Can't help you with the error message without seeing what the XML looks like.

    To use something better than alert, there are many possibilities.

    Perhaps the simplest (but not best):
    Code:
         document.getElementById("listOfJobIds").innerHTML += "," + jobID;
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •