Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-15-2012, 12:33 PM   PM User | #1
yesakmac
New to the CF scene

 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
yesakmac is an unknown quantity at this point
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!
yesakmac is offline   Reply With Quote
Old 10-15-2012, 07:35 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,237
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Tags
javascript, parse, xml

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:29 AM.


Advertisement
Log in to turn off these ads.