Adds jQuery collection to objects that will be used as global events context if provi...
[jquery.git] / test / data / jsonp.php
index 7500025..6c13d72 100644 (file)
@@ -1,10 +1,14 @@
-<?php\r
-error_reporting(0);\r
-$callback = $_REQUEST['callback'];\r
-$json = $_REQUEST['json'];\r
-if($json) {\r
-       echo $callback . '([ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ])';\r
-} else {\r
-       echo $callback . '({ "data": {"lang": "en", "length": 25} })';\r
-}\r
-?>\r
+<?php
+error_reporting(0);
+$callback = $_REQUEST['callback'];
+if ( ! $callback ) {
+       $callback = explode("?",end(explode("/",$_SERVER['REQUEST_URI'])));
+       $callback = $callback[0];
+}
+$json = $_REQUEST['json'];
+if($json) {
+       echo $callback . '([ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ])';
+} else {
+       echo $callback . '({ "data": {"lang": "en", "length": 25} })';
+}
+?>