【发布时间】:2015-09-02 04:12:37
【问题描述】:
有没有办法将 XML url 转换为 JSON url 以便我可以在我的网站中使用它?
{"breakfast_menu": {
"food": [
{
"name": "Belgian Waffles",
"price": "$5.95",
"description": "Two of our famous Belgian Waffles with plenty of real maple syrup",
"calories": "650"
},
{
"name": "Strawberry Belgian Waffles",
"price": "$7.95",
"description": "Light Belgian waffles covered with strawberries and whipped cream",
"calories": "900"
},
{
"name": "Berry-Berry Belgian Waffles",
"price": "$8.95",
"description": "Light Belgian waffles covered with an assortment of fresh berries and whipped cream",
"calories": "900"
},
{
"name": "French Toast",
"price": "$4.50",
"description": "Thick slices made from our homemade sourdough bread",
"calories": "600"
},
{
"name": "Homestyle Breakfast",
"price": "$6.95",
"description": "Two eggs, bacon or sausage, toast, and our ever-popular hash browns",
"calories": "950"
}
]}}
假设 URL 为 http://www.w3schools.com/xml/simple.xml,那么如何将其转换为 JSON,以便在 AngularJS 中使用它
【问题讨论】:
标签: javascript json xml angularjs