SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    object document display

    I have created a servlet that does nothing more than create a XML file.

    i have got some JQuery code that reloads the servlet to get the XML data.

    This works fine and i am able to load the data i want, the problem i have is that when the data is loaded to the jsp page it displays [object Document] in front of my output.

    Have i made a mistake on my jquery code?

    Code JavaScript:
                $(document).ready(function() {
     
                    setInterval(function() {
                    	var data = "";
                        $.get('Stocks', function(data) {
                        	$('converted-values',data).each(function(i){
                        		var row = $(this).find("row1").text();
                        		data = data + row;
                        	});
     
                            $('#time').text(data);         
                        });
                    }, 1000); // 1000 milliseconds = 1 second.
                });

    XML file only has one value, called row 1 with the data, "wow this is cool", but my output is:

    [object Document] wow this is cool

  2. #2
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FIXED, not sure what i did!


Bookmarks

Posting Permissions

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