Return data from iframetransport

Return data from iframetransport

I am using the jquery file jquery-iframe-transport to send blobs to a database via an iframe. It works fine except it doesn't seem to be clear on how to get data back (yes it does have a section if you DONT know what kind of data you are getting back, but i know I am getting JSON).


This is how data can be received after the post

    $("#myform").submit(function() {
    $.ajax(this.action, {
        data: $(":text", this).serializeArray(),
        files: $(":file", this),
        iframe: true,
        processData: false,
        dataType : "json"
    }).complete(function(data) {
        console.log(data.responseText);
    });


In my PHP I am returning data as such

    echo json_encode(array("rowData"=> '<div class = "container" data-id = "'.$row['rowid'].'">
      <div class = "blob"><img src="data:image/jpeg;base64,'.base64_encode( $row['blob'] ).'"/></div>
      <div class = "rowInfo">
         <div class = "name"><p>'.$row['name'] .'</p></div>
          ....etc

Now my issue is I cannot process this data because I get some gamebreaking errors.

First my GET (I don't even know who or what is trying to GET by the way) is telling my my Request-URI is too large, because of the blob. 

Secondly my json data is full of \t\t\t\t\t and \n and I have no idea why. Basically my response looks like this:

    {"rowData":"\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<\/p><\/div>\n\t\t\t\t\t\t\t<\/p><\/div>\n\t\t\t\t\t\t\t<\/p><\/div>\n\t\t\t\t\t\t\t1<\/p><\/div>\n\t\t\t\t\t\t\t<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>"}

I don't know what the heck that is and why it happens.

Does anyone have any advice for me? Thanks.