I have a json file with this structure:
myCallback({
"title": "data",
"content": "data",
"images": [
{
"img1": "data",
"img2": "data"
}
]
})
I would like to know it it is possible to parse the file and extract for example only the title, before it is completely finished downloading.
json files are stored in a remote server, therefor I use jsonp and later parse the full file, but I would like to skip the images (base64 encoded) and only download the first part / title / content.
I would like to know it it is possible to parse the file and extract for example only the title, before it is completely finished downloading.
Because you're using JSONP, no, this is not possible. JSONP by nature cannot be streamed. It relies on a cooperative server passing well-formed data to your page in a <script>
tag.
Want less data? You'll have to convince the remote server to give you less.