mootools에서 카운트 다운 후 mysql_query를 실행하려고하는데 어떻게해야할지 모르겠습니까? 지금까지 요소 내에서 variabla 텍스트를 출력 할 수 있지만 내부에서 PHP 코드를 실행할 수 없습니다. 누구나 아이디어가 있으십니까?mootools 요소 내에서 mysql 쿼리를 실행 하시겠습니까?
제목 없음
<body>
<script type="text/javascript">
var CountDown = new Class({
//implements
Implements: [Options,Events],
//options
options: {
element: 'countdown',
start: 10,
finish: 0,
startFont: '12px',
finishFont: '12px',
onComplete: $empty,
duration: 1000
},
//initialization
initialize: function(options) {
//set options
this.setOptions(options);
},
//get things started
start: function() {
this.anim();
},
//animate!
anim: function() {
this.options.element.set('text',this.options.start--);
var fx = new Fx.Tween(this.options.element,{
duration: this.options.duration,
link: 'ignore',
onComplete: function() {
if(this.options.start >= this.options.finish) {
this.anim();
} else {
this.fireEvent('complete');
}
}.bind(this)
}).start('font-size',this.options.startFont,this.options.finishFont);
}
});
/* usage */
window.addEvent('domready',function() {
var cd = new CountDown({
element: $('countdown'),
start: <?=$timer;?>,
finish: 0,
onComplete: function() {
// here i want to execute a mysql_query instead of output these vaiablesa s text
this.options.element.set('text','<?=$test1?><?=$test2?><?=$test3?>');
}
}).start();
});
</script>
<div id="countdown"></div>
</body>
</html>
안녕하세요. matt, 정확히 내가 전에 시도한 것입니다. Request.HTML 및 request.JSON 것은 알고 있지만 카운트 다운 후 url 호출을 구현하지 못했습니다. hello.php? variable1 = hello & variable2 = john 카운트 다운 후 어떻게해야합니까? 나는 HTML 요청을 넣으려고했으나 실패했습니다 ...하지만 mysql_query를 직접 실행하는 대신 내 테이블을 업데이트하는 파일의 url을 실행하는 것이 마음에 들었습니다 ... 어떻게 할 것입니까? 고마워요 – randy
글쎄, 그게 네 질문에 대한 해답이야. 아약스를 사용하는 방법을 알아낼 수 없다면 새로운 질문을하십시오. –