When using activemenu with the devel module I noticed it stopped working. This is because devel module inserts it's output to any page, even javascript output, if the header Content-Type: text/javascript; charset=utf-8 is not set.

When fixing activemenu I realised that this is probably a problem for the other modules as well, so I backported the newly added drupal_json() from D6. Only tested from activemenu though.

Comments

anders.fajerson’s picture

StatusFileSize
new5.54 KB

Forgot to remove exit(). Also, this issue gives background to drupal_json(): http://drupal.org/node/115139

nedjo’s picture

Status: Needs review » Needs work

Thanks for the patch. I want to apply this.

In http://drupal.org/node/115139 we excluded upload's JSON because it's loaded into an iframe. In jstools we use iframe loading as well (via the Drupal.redirectFormSubmit() in jstools.js). Presumably we need to exclude those JSON responders?

TODO: determine which responders to exclude, and add code comments noting that they're excluded and why.