Skip to content

Instantly share code, notes, and snippets.

@siteslave
Created June 14, 2013 09:27
Show Gist options
  • Save siteslave/5780625 to your computer and use it in GitHub Desktop.
Save siteslave/5780625 to your computer and use it in GitHub Desktop.
how_to_jsonp
<?php
$cb = $this->input->post('callback');
$rs = $this->epidem->get_epidem($date_start,$date_end);
$rows = json_encode($rs);
$json = $cb . '({"success": true, "rows": ' . $rows.'})';
// don't render json
#$this->_render_json($json);
echo $json;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment