jQuery에서 PHP의 계산 된 숫자를 사용할 수없는 이유는 무엇입니까?Javascript/jQuery에서 PHP 변수 사용
나는이 시도했다 :
<div id="time">
<? echo until();?>
</div>
var until = $("#time").html();
그리고
var until = <? echo until();?>;
을하지만 아무도 D 작동하지 않습니다 :
편집 : 계산 된 수는 472,541, 그리고 기능이 될 것입니다 :
<?
/**
* @desc Time until tuesday
* @param string Time format
* @return string timestamp
*/
function until($format = ""){
$now = strtotime("now");
$nextTuesday = strtotime("-1 hour next tuesday");
$until = $nextTuesday - $now;
if(empty($format)){
return $until;
}else{
return date("$format",$until);
}
}
>
편집 편집 : O : D 덕분에 많은 사람 A : D
수 (doog) 도움이하기 위해 답변을 업데이트하세요? 기타? – Veger
메소드와 생성 된 HTML까지 게시 할 수 있습니까? – Joe
결과 소스 코드를 살펴 보았습니까? – Chronial