So I've ran into an interesting issue, and wanted to solicit feedback from people more involved with ahah/ajax development for drupal than I....<br><br><a href="http://malsup.com/jquery/form/#code-samples">http://malsup.com/jquery/form/#code-samples</a> -- see the file uploads tab and the information regarding json/javascript responses.<br>
<br>The concrete issue I'm dealing with is the Add another item button for CCK... For Filefield if you've selected a file to upload and press the 'Add Another Item' button you get an error. You get this error because drupal_json sets the text/javascript header, and the iframe doesn't accept that... <br>
<br>This issue can be solved easily just by having CCK's ahah handler simply print drupal_to_js instead of using drupal json. This however will not solve more systemic issues with people adding file uploads to other ajax handled forms.<br>
<br>There are a couple solutions I can think of...<br> 1) have ahah set the iframe option to true and use iframes, and add the textarea to drupal_json.<br> 2) check the _SERVER['HTTP_ACCEPT'] and decide which header to set whether to wrap output in a textarea<br>
3) hack around it on a case by case basis<br><br>I was hoping some of the more jquery ahah astute might have better suggestions for achieveing some kind of consistency.<br>We should probably add $_GLOBAL['devel_shutdown'] = FALSE to drupal_json regardless...<br>
<br><br>.darrel.<br>