JavaScript AJAX Basics (retiring) AJAX Concepts Finish the XML Document

Quiz : Add 3 more songs to this XML document. Include title and artist for each song

This is my code

<?xml version="1.0" encoding="UTF-8"?> <songs>
<song> [ { "title" : "My Way", "artist" : "Frank Sinatra"},

  {
  "title" : "Call Me",
  "artist" : "Katie Perry"},

  {
  "title" : "For Me",
  "artist" : "Mary Steward"},

  {
  "title" : "Wind beneath my wings",
  "artist" : "Bette Midler"}
]

</song> </songs>

songs.xml
<?xml version="1.0" encoding="UTF-8"?>
<songs>  
    <song>
    [
      {
        "title" : "My Way", 
        "artist" : "Frank Sinatra"},

      {
      "title" : "Call Me",
      "artist" : "Katie Perry"},

      {
      "title" : "For Me",
      "artist" : "Mary Steward"},

      {
      "title" : "Wind beneath my wings",
      "artist" : "Bette Midler"}
    ]
  </song>
</songs>

1 Answer

Steven Parker
Steven Parker
176,604 Points

It looks like you added new songs but converted all 4 of them into JSON format. But this code is XML, not JSON.

Add the new songs using the same format that the original was was in already. Don't change the original one.

Thanks Steve! That worked!