小编use*_*030的帖子

如何使javascript计时器重新加载

我从我的html页面的论坛获得了这个Javascript代码:

<html>
<head>
<title>Countdown</title>
<script type="text/javascript">
// set minutes
var mins = 0.1;

// calculate the seconds (don't change this! unless time progresses at a different speed for you...)
var secs = mins * 60;
function countdown() {
    setTimeout('Decrement()',1000);
}

function Decrement() {
    if (document.getElementById) {
        minutes = document.getElementById("minutes");
        seconds = document.getElementById("seconds");
        // if less than a minute remaining

        if (seconds < 59) {
            seconds.value = secs;

        } else {
            minutes.value = getminutes();
            seconds.value = getseconds();
        }
        secs--;
        setTimeout('Decrement()',1000);

    } …
Run Code Online (Sandbox Code Playgroud)

html javascript

5
推荐指数
1
解决办法
278
查看次数

Php如何将变量放在变量中

我有这个代码:

echo $b1[1][wood];   // It would say 100
Run Code Online (Sandbox Code Playgroud)

但我想改变$ b1中的1,例如:

$id = 1;
echo $b(The $id here)[1][wood];
Run Code Online (Sandbox Code Playgroud)

我试过了

echo $b'.$id.'[1][wood];  
Run Code Online (Sandbox Code Playgroud)

但它没有用.有没有人有什么建议 ?

谢谢

php variables

2
推荐指数
1
解决办法
62
查看次数

标签 统计

html ×1

javascript ×1

php ×1

variables ×1