I am a network engineer trying to build an interface for displaying data from a server on a webpage. I am new to development and I think the problem I'm struggling with is probably an easy question for an experienced developer.
I have a server that accepts HTTP GET requests and returns an XML file. I need to make a script that pull data via HTTP GET request from a separate server, parse it and display it when a link is clicked on by a user.
Details:
I need to have someone be able to click on a link, and have it display on the next page, or on a popup or whatever the results of pulling an XML file from an "http://server.com/getdata.htm?thisdata". When it does this it will get an XML file that will say something like:
<result>15</result>
I need just the "15" to show up.
Bonus points to how I can change the color of the page or display a different icon depending on what the result is..
JavaScript is a reasonable option for this task. It can fetch the remote XML file with a GET request and parse it. I've only done it once and it was a while ago, so I'd suggest that you search on "javascript parse XML AJAX". You should find lots of example scripts that will include these functions. For me, the complexity of the XML document would largely determine how difficult it would be, and I'm exaggerating a bit there. Once you understand the flow of the JavaScript parsing syntax, you should be fine.
Bookmarks