carsRST
asked on
JSON - Iframe
I have an upload page that returns JSON. For AJAX purposes, I'm using an Iframe. I'm trying to capture the data as shown below, but not having luck. Hoping someone could shed some light.
var result = JSON.parse($('body', this.contentWindow.documen t).html()) ;
if(result.success == 1) { ...}
Only thing that happens is the JSON data is returned and downloaded as a file.
Here's the JSON data returned:
{"success":1,"file_name":" 3rd Grade Times-v1.xlsx","file_div": "cube_acce pted_date" }
var result = JSON.parse($('body', this.contentWindow.documen
if(result.success == 1) { ...}
Only thing that happens is the JSON data is returned and downloaded as a file.
Here's the JSON data returned:
{"success":1,"file_name":"
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks, Leakim, but it's still forcing a download of the JSON data.
Now that I think about it. I think I may need to capture the JSON data on my IFRAME as oppose to reading the HTML on the IFrame.
Now that I think about it. I think I may need to capture the JSON data on my IFRAME as oppose to reading the HTML on the IFrame.
ASKER
Thanks, Leakim. I will use your suggestions.
You're welcome! Have a nice week-end!
ASKER
I'm out right now but will try later.