Here is what I use for requests with the following header:
Accept:application/json, text/javascript, */*; q=0.01
<If "%{HTTP_ACCEPT} =~ /json/"> ProxyErrorOverride Off</If>
A simpler solution:
Keep all scripts that return json in a separate directory, such as /ajax or /api, then configure Apache like this:
/ajax
/api
ProxyErrorOverride On<Directory "/path/to/ajax/or/api"> ProxyErrorOverride Off</Directory>