2011-06-01 54 views
1

我是mootools的初學者,任何人都可以幫助我弄清楚如何在JSON中有效解碼每個這些喊話以登錄控制檯。Mootools Request.JSON解碼

 var shoutsRequest = new Request.JSON(
      { 
       url: this.url, 
       onSuccess: function(shouts) 
       { 
        console.log(JSON.decode(shouts)); 
       }, 
       onError: function(text, error) 
       { 
        console.log(text) 
       } 
      } 
     ).get(); 

這裏是JSON。

[ 
    {id:"1", username:"codyrob", shout:"This is a test.", time:"May 30, 3:20 pm"}, 
    {id:"2", username:"codyrob", shout:"This is a test.", time:"May 30, 3:20 pm"}, 
    {id:"3", username:"codyrob", shout:"This is a test.", time:"May 30, 3:20 pm"}, 
    {id:"4", username:"codyrob", shout:"This is a test.", time:"May 30, 3:20 pm"}, 
    {id:"5", username:"codyrob", shout:"This is a test.", time:"May 30, 3:20 pm} 
] 

回答