public function _json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document",$immediatly=false) {
		$jsCallback=isset($jsCallback) ? $jsCallback : "";
		$retour=$this->_getAjaxUrl($url, $attr);
		$retour.="$.{$method}(url,".$params.").done(function( data ) {\n";
		$retour.="\tdata=$.parseJSON(data);for(var key in data){"
				."if($('#'+key,".$context.").length){ if($('#'+key,".$context.").is('[value]')) { $('#'+key,".$context.").val(data[key]);} else { $('#'+key,".$context.").html(data[key]); }}};\n";
				$retour.="\t".$jsCallback."\n".
						"\t$(document).trigger('jsonReady',[data]);\n".
						"});\n";
				if ($immediatly)
					$this->jquery_code_for_compile[]=$retour;
					return $retour;
	}
public function _json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document",$immediatly=false) {
		$jsCallback=isset($jsCallback) ? $jsCallback : "";
		$retour=$this->_getAjaxUrl($url, $attr);
		$retour.="$.{$method}(url,".$params.").done(function( data ) {\n";
		$retour.="\tdata=$.parseJSON(data);for(var key in data){"
				."if($('#'+key,".$context.").length){ if($('#'+key,".$context.").is('[value]')) { $('#'+key,".$context.").val(data[key]);} else { $('#'+key,".$context.").html(data[key]); }}};\n";
				$retour.="\t".$jsCallback."\n".
						"\t$(document).trigger('jsonReady',[data]);\n".
						"});\n";
				if ($immediatly)
					$this->jquery_code_for_compile[]=$retour;
					return $retour;
	}
public function _json ( $ url , $ method = "get" , $ params = "{}" , $ jsCallback = NULL , $ attr = "id" , $ context = "document" , $ immediatly = false ) { $ jsCallback = isset ( $ jsCallback ) ? $ jsCallback : "" ; $ retour = $ this -> _getAjaxUrl ( $ url , $ attr ) ; $ retour .= "$.{$method}(url," . $ params . ").done(function( data ) {\n" ; $ retour .= "\tdata=$.parseJSON(data);for(var key in data){" . "if($('#'+key," . $ context . ").length){ if($('#'+key," . $ context . ").is('[value]')) { $('#'+key," . $ context . ").val(data[key]);} else { $('#'+key," . $ context . ").html(data[key]); }}};\n" ; $ retour .= "\t" . $ jsCallback . "\n" . "\t$(document).trigger('jsonReady',[data]);\n" . "});\n" ; if ( $ immediatly ) $ this -> jquery_code_for_compile [ ] = $ retour ; return $ retour ; }
Makes an ajax request and receives the JSON data types by assigning DOM elements with the same name
@param string $url the request address
@param string $params Paramètres passés au format JSON
@param string $method Method use
@param string $jsCallback javascript code to execute after the request
@param boolean $immediatly
Makes an ajax request and receives the JSON data types by assigning DOM elements with the same name