www.webdeveloper.com
Results 1 to 4 of 4

Thread: Javascript and HTTP GET Requests Help

  1. #1
    Join Date
    Oct 2012
    Posts
    2

    Javascript and HTTP GET Requests Help

    Hello,

    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..

    Any thought?

    Any help is GREATLY appreciated!

    Thanks!

  2. #2
    Join Date
    Oct 2012
    Posts
    2
    Also I should ask.... am I going about this the wrong way?

  3. #3
    Join Date
    Mar 2011
    Posts
    1,135
    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.
    Rick Trethewey
    Rainbo Design

  4. #4
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    The XMLHttpRequest class should do the trick: http://www.w3schools.com/xml/xml_http.asp
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles