I'm struggling with parsing JavaScript. I am trying to extract the value of "title" and "permalink", as well as the value of "basename" labeled "image_01". The desired output is
http://blog.url/news/images/201516.jpg
<div id="placeholder"></div>
<script>
var data={
"items": [
{
"title": "HELLO THIS IS TITLE",
"customFields": [
{
"basename": "image_01",
"value": "<form mt:asset-id=\"352706\" class=\"mt-enclosure mt-enclosure-image\" style=\"display: inline;\"><a href=\"http://blog.url/news/images/201516.jpg\">201516.jpg<\/a><\/form>"
},
{
"basename":"image_02",
"value":"<form mt:asset-id=\"352705\" class=\"mt-enclosure mt-enclosure-image\" style=\"display: inline;\"><a href=\"http://blog.url/news/images/201516.jpg\">201517.jpg<\/a><\/form>"
},
{
"basename":"image_03",
"value":""
},
],
"permalink": "http://blog.com/index.php"
}
]
}
document.getElementById("placeholder").innerHTML=data.items[0].title + " " + data.items[0].permalink+"--"+ data.items[0].customFields[0].basename[0].image_01;
</script>