在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ HTML問答
孤影 回答
為什么會是立即輸出0,1,2,3,4,而不是每隔1秒輸出一個數(shù)字

如果要每隔一段時間執(zhí)行一次,

for (var i = 0; i < 5; i++) {
  setTimeout(fn, i * 1000);
}

而你調(diào)用了立即執(zhí)行函數(shù),實際上是:

for (var i = 0; i < 5; i++) {
  setTimeout(fn(), i * 1000);
}

能明白么?

(function(i) {
    console.log(i);
  })(i)

你再看看你這個代碼,是 fn 還是 fn()

喵小咪 回答

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="layui/css/modules/layer/default/layer.css"/>
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
    <script src="https://cdn.bootcss.com/jquery/2.1.0/jquery.js"></script>
    <script src="layui/lay/modules/layer.js">
    </script>
    
</head>
<style type="text/css">
    #our{
        width: 200px;
        height: 50px;
        background: red;
    }
    #you{
        width: 200px;
        height: 50px;
        background: blue;
    }
</style>
<body>
    
    <div id="our">
        我們
    </div>
    <div id="you">
        你們
    </div>
</body>

</html>
<script type="text/javascript">

$("#our").on("click",function(){
    layer.open({
     type: 1,
     skin: 'layui-layer-rim', //加上邊框
     area: ['1000px', '700px'], //寬高
     title: '帖子詳情',  
    content: "加油"
 
      });
})
$("#you").on("click",function(){
    layer.open({
     type: 1,
     skin: 'layui-layer-rim', //加上邊框
     area: ['1000px', '700px'], //寬高
     title: '帖子詳情',  
    content: "必勝"
 
      });
})

</script>

尐飯團 回答
<el-select ref="mySelect"></el-select>

this.$refs.mySelect.handleClose()

github上的源碼

青瓷 回答

Npm+webpack

用npm下載需要的包, 然后用webpack打包js+css。

有點壞 回答

你的工程網(wǎng)絡(luò)請求是不是用到了代理

款爺 回答
<el-tab-pane v-for="(row,index) in rows" :label="`報告單${index+1}`">
</el-tab-pane>
雨蝶 回答

getElementsByClassName的返回值是個nodeList,類數(shù)組結(jié)構(gòu),所以應(yīng)該要取角標

 a[0].style.top = img * speed +'px';

嘗試修改成這樣是否有效果

心上人 回答

一段代碼的作用要看使用環(huán)境,一個功能的實現(xiàn)可能有很多種寫法

下面的寫法是我們最常見也是最常用的,那么上面的代碼和下面的代碼有什么區(qū)別呢?

區(qū)別就是上面的代碼,sayName屬性是作用在子對象上的,而下面的代碼是作用在父對象上的

上面的代碼如果修改一下

function Persion(hasSayName) {
    //...
    if(hasSayName && typeof this.sayName !=="function"){
        //...
    }
}
var p1 = new Persion
var p2 = new Persion(true)

這樣,代碼的用意就特別清晰了

胭脂淚 回答

一:不要寫行內(nèi)樣式,權(quán)重太高,CSS就影響不到了。
二:用css 就能解決
<style>

    #parent{
        height: 50px;
        background: red;
    }
    #son{
        height: 30px;
        background: blue;
    }
    #parent:hover{
        height: 200px;
    }
    #son:hover #parent{
        height: 200px;
    }
</style>
莫小染 回答

阻止別人iframe嵌入你的頁面

蟲児飛 回答

一般是放在onload中,在頁面開始加載就進行數(shù)據(jù)的獲取。如果是需要返回這個頁面也加載數(shù)據(jù),就封裝一下,在onshow里面調(diào)用。我是這么搞的

浪婳 回答
  • 舊項目已經(jīng)使用了80端口 而新的node項目啟用的端口是3000,訪問的方式該是 http://ip:3000/getat
  • 如果希望 http://112.74.191.12/getat 這樣的形式去訪問 可使用nginx 根據(jù)location進行代理轉(zhuǎn)發(fā)
  1. 舊的項目放棄80端口,將nginx作為80端口,因為80端口只能有一個。
  2. 舊的項目啟用新的端口,通過nginx端口配置,訪問nginx時會轉(zhuǎn)發(fā)到舊項目上
  3. 新的node項目 再根據(jù)location進行代理轉(zhuǎn)發(fā)

location配置:
location /getat {

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://127.0.0.1:3000;

}

呆萌傻 回答

第一個在GitHub上,貌似是一樣的功能(跟reduce沒啥關(guān)系,不過邏輯是一樣的):https://github.com/Jiasm/note...

第二個看起來是這樣的操作,如果非要用reduce的話:

[{ name: 'a', children:[{ name: 'a-1' }] }, { name:'b', children: [{ name: 'b-1' }] }].reduce((results, current) => 
  results.concat({ name: current.name }, ...current.children)
, [])
硬扛 回答
import pandas as pd

data1 = [{'a': '1', 'b': ''}, {'a': '', 'b': '2'}]
data2 = [{'a': '', 'b': '3'}, {'a': '4', 'b': ''}]

df1 = pd.DataFrame(data1)
df2 = pd.DataFrame(data2)

for i, row in df1.iterrows():
    for key in row.keys():
        if not row[key]:
            row[key] = df2.loc[i][key]

print df1
雨萌萌 回答

試試以下方式:

  1. 將header設(shè)為{"Content-Type": "application/x-www-form-urlencoded"}
  2. json結(jié)構(gòu)數(shù)據(jù)使用url編碼方式設(shè)置到body中,如:
    body: {foo: bar, yoo: sar} => body: 'foo=bar&yoo=sar'
糖豆豆 回答

try{

//可能錯誤的代碼

}catch(err){

//這個err就是錯誤信息. 
div.text = err;

}