3
jQuery.get("oberonmetadata.xml", function(metadata){
    console.log(metadata);
});

This shows me [column,column,.... (as shown in pic below)] in console and when I click on it, it exands its whole object tree structure...

Whereas all I want to see is metadata.xml file in console. This works flawlessly in chrome but in IE-9 and mozilla I am unable to do it.

enter image description here

Thanks

Tintin
  • 2,853
  • 6
  • 42
  • 74
  • It is working as intended, you are seeing the xml document. To ensure that it gets parsed properly in all browsers, add `,"xml")` to the end after `}` – Kevin B Oct 12 '12 at 21:27
  • This might help you: http://stackoverflow.com/questions/6507293/convert-xml-to-string-with-jquery – andyengle Oct 12 '12 at 21:31
  • Kevin... How can I see the XML in console. Its showing me the whole object. In chrome I see the xml. I have edited my question and have put an image too. – Tintin Oct 12 '12 at 22:02
  • @andy - no i am not looking to convert to string. I need to see xml (which will be formatted and easy to read) in console itself. – Tintin Oct 12 '12 at 22:07

2 Answers2

0

Try console.log(metadata.xml);

See here for more info.

Rob Hardy
  • 1,821
  • 15
  • 15
0

If you simply want to log the response to console, utilize the 3rd parameter passed to the success callback and examine its responseText property which contains a string representation of the document returned.

$.get("oberonmetadata.xml", function(data, status, response){
    console.log(response.responseText);
});

This works for me in all browser environments.

Rob Hardy
  • 1,821
  • 15
  • 15