| @@ 1073-1089 (lines=17) @@ | ||
| 1070 | return http_build_query($data, null, '&'); |
|
| 1071 | } |
|
| 1072 | ||
| 1073 | public static function get($url, $data = null, $callback = null, $type = null) |
|
| 1074 | { |
|
| 1075 | if (!is_array($data)) { |
|
| 1076 | $callback = $data; |
|
| 1077 | $data = null; |
|
| 1078 | } |
|
| 1079 | // TODO some array_values on this shit |
|
| 1080 | return PhpQuery::ajax( |
|
| 1081 | array( |
|
| 1082 | 'type' => 'GET', |
|
| 1083 | 'url' => $url, |
|
| 1084 | 'data' => $data, |
|
| 1085 | 'success' => $callback, |
|
| 1086 | 'dataType' => $type, |
|
| 1087 | ) |
|
| 1088 | ); |
|
| 1089 | } |
|
| 1090 | ||
| 1091 | public static function post($url, $data = null, $callback = null, $type = null) |
|
| 1092 | { |
|
| @@ 1091-1106 (lines=16) @@ | ||
| 1088 | ); |
|
| 1089 | } |
|
| 1090 | ||
| 1091 | public static function post($url, $data = null, $callback = null, $type = null) |
|
| 1092 | { |
|
| 1093 | if (!is_array($data)) { |
|
| 1094 | $callback = $data; |
|
| 1095 | $data = null; |
|
| 1096 | } |
|
| 1097 | return PhpQuery::ajax( |
|
| 1098 | array( |
|
| 1099 | 'type' => 'POST', |
|
| 1100 | 'url' => $url, |
|
| 1101 | 'data' => $data, |
|
| 1102 | 'success' => $callback, |
|
| 1103 | 'dataType' => $type, |
|
| 1104 | ) |
|
| 1105 | ); |
|
| 1106 | } |
|
| 1107 | ||
| 1108 | public static function getJSON($url, $data = null, $callback = null) |
|
| 1109 | { |
|
| @@ 1108-1124 (lines=17) @@ | ||
| 1105 | ); |
|
| 1106 | } |
|
| 1107 | ||
| 1108 | public static function getJSON($url, $data = null, $callback = null) |
|
| 1109 | { |
|
| 1110 | if (!is_array($data)) { |
|
| 1111 | $callback = $data; |
|
| 1112 | $data = null; |
|
| 1113 | } |
|
| 1114 | // TODO some array_values on this shit |
|
| 1115 | return PhpQuery::ajax( |
|
| 1116 | array( |
|
| 1117 | 'type' => 'GET', |
|
| 1118 | 'url' => $url, |
|
| 1119 | 'data' => $data, |
|
| 1120 | 'success' => $callback, |
|
| 1121 | 'dataType' => 'json', |
|
| 1122 | ) |
|
| 1123 | ); |
|
| 1124 | } |
|
| 1125 | ||
| 1126 | public static function ajaxSetup($options) |
|
| 1127 | { |
|