I have a page with a form that has a file upload input item targeted to a hidden iframe. When the form is posted to the iframe the server processes the file and returns a json object. I’m not sure how to use jquery, or plain old javascript for that matter, to listen for the returned object. I have some code set up for my iframe such as…
$("#upload_target").load(function () {
//what to do here - how do I get the json object?
});
Does anyone know how to wire up jquery to listen for the json object that’s sent back to the iframe? Thanks.
I finally figured out how to do it….
Whether it’s the right way or not, it works.
edit – actually I got a bit ahead of myself. here’s the correct code….
One thing I had to also change was making sure that my MVC controller action was setting the JSONResult.ContentType = “text/plain”. Otherwise I was getting a save as download dialog.