Merge branch 'fix-7853-add-context' of https://github.com/dmethvin/jquery into dmethv...
[jquery.git] / test / data / jsonp.php
1 <?php
2 error_reporting(0);
3 $callback = $_REQUEST['callback'];
4 if ( ! $callback ) {
5         $callback = explode("?",end(explode("/",$_SERVER['REQUEST_URI'])));
6         $callback = $callback[0];
7 }
8 $json = $_REQUEST['json'];
9 if($json) {
10         echo $callback . '([ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ])';
11 } else {
12         echo $callback . '({ "data": {"lang": "en", "length": 25} })';
13 }
14 ?>