Link to home
Create AccountLog in
Avatar of carsRST
carsRSTFlag for United States of America

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.document).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_accepted_date"}
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of carsRST

ASKER

Thanks, leakim.

I'm out right now but will try later.
Avatar of carsRST

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.
Avatar of carsRST

ASKER

Thanks, Leakim.  I will use your suggestions.
You're welcome! Have a nice week-end!