ãªã¯ã¨ã¹ãã®ãã°ãè¨é²ãã¦ããã¨ãã«jQueryã®ajaxéä¿¡ã使ãå ´åã¯é¤å¤ãããã£ãã®ã§ããµã¼ãã¼å´ã§å¤å¥ããæ¹æ³ã調ã¹ãã¡ã¢ã ç°å¢å¤æ°ã®HTTP_X_REQUESTED_WITHãè¦ãã°åããã¿ããããµã¼ãã¼ãµã¤ãï¼PHPï¼ã®ãµã³ãã«ã³ã¼ãã¯ä¸ã®ãããªæãã /** * Ajaxã«ãããªã¯ã¨ã¹ããã©ãã * * @return boolean True or False */ public function isAjax() { if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){ return true; } return false; } ããã§å¤æã§ããã®ã¯jQueryãajaxéä¿¡ãããã¨ãã®ãªã¯ã¨ã¹
{{#tags}}- {{label}}
{{/tags}}