andkjaer
andkjaer

Reputation: 4065

jquery get object value

How do I get get the value url from this string:

[{
    "url": "https://www.filepicker.io/api/file/WGS4Wmkk",
    "filename": "4827889.jpg",
    "mimetype": "image/jpeg",
    "size": 53113,
    "key": "be7BxONVHe_48278891840.jpg",
    "isWriteable": false
}]

With jquery or regular javascript

Upvotes: 0

Views: 8569

Answers (1)

David Hellsing
David Hellsing

Reputation: 108530

If str is the string you posted above, you can use JSON to parse it:

var data = JSON.parse(str);
console.log(data[0].url); // the url value

Upvotes: 8

Related Questions