I am attempting to get data from an inline array wrapped in a <script>
tag using jQuery's .getJSON
method. As far as I am reading in documentation (http://api.jquery.com/jquery.getjson/), .getJSON
requires a URL and external file to call from.
$.getJSON('items.js', function(data) {});
How would I use either this method or another one to specifically target an inline array (without an external file), such as the one below:
<script type="application/json">
{
"items": {
"blue": {
"a": "a",
"b": "b",
"c": "c"
}
}
}
</script>
Thanks!