I was hoping someone could help me set up the views datasource module to output JSONP code. Im not trying to CREATE, UPDATE, or DELETE anything on my drupal site. Im just trying to output the jsonp code so that my server on another domain can access it. As of now, im outputting json code but im not sure how to make that JSONP.

Comments

kblanch09’s picture

I see the JSONP Prefix that is in the settings, but when I add a unique value there, it gives me a notice saying undefined index of whatever I entered in the JSONP Prefix.

anthonylindsay’s picture

Status: Active » Closed (fixed)

Cannot reproduce the error in #1. I suspect that if there was an issue when this ticket was logged it has since been fixed. Closing.

For anyone who stumbles upon this thread, the answer is to go to the format settings for your view display, having chosen 'json data document' as the output type. You turn JSON into JSONP by entering your chosen prefix whereupon the JSON output will be enclosed with parentheses and prefixed by this label, et voila.