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 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2007
    Posts
    33
    Thanks
    7
    Thanked 0 Times in 0 Posts

    using responseXML

    ok I want to use responseXML in ajax because I'm generating two tables in jsp and sending it to my js file. Now these are two simple tables like so:
    Code:
    <table>
    some trs, some tds, few select boxes
    </table>
    <table>
    some trs, some tds
    </table>
    thats all thats in the string that jsp response gives to AJAX, I would just like to know how to give these to AJAX in xml (wanna know if ill have to learn xml just for this?) so if anybody can post the conversion i'd be much obliged
    Last edited by zenithwolf; 09-07-2007 at 10:04 PM.

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,461
    Thanks
    11
    Thanked 600 Times in 580 Posts
    for me, i think it would be easier and simpler to send them as JSON. This also leverages your js knowledge in lieu of learning xml just to deliver data to script.
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    If you want to use responseXML, the document has to be a valid xml document. The code you posted is not a valid xml document.

    http://www.validome.org/xml/

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    New Coder
    Join Date
    Aug 2007
    Posts
    33
    Thanks
    7
    Thanked 0 Times in 0 Posts
    yea I know my format is far from being xml, I wanted to know how I can get responseXML to contain such an arrangement and how I can display it with my AJAX

    hmm looking at JSON now...thx I wasn't aware JSON existed
    Last edited by zenithwolf; 09-09-2007 at 03:21 AM.


  •  

    Posting Permissions

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