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

鍍金池/ 問答/ HTML問答
尐潴豬 回答

你的想法以前也有人想過的, 然后 pjax 就出來了

淡墨 回答

把你的html改成這樣

<div id="big">
        <div id="box">
            <input type="text"><input type="button" value="測(cè)試">
        </div>
    </div>
陌顏 回答

你在函數(shù)外面聲明生成 你內(nèi)部生成有什么用。。。。

孤毒 回答
怎么能將注釋一并讀取發(fā)送到前端?或者繞過注釋直接讀取未注釋的代碼段?

json是不可能json的,一輩子都不可能json。最好的方式當(dāng)然是把注釋去掉咯?;蛘?/p>

  1. 正則把/*...*/去掉。
  2. 把注釋改成一個(gè)描述字段或者擴(kuò)展字段。
  3. JSON.parse去掉,不請(qǐng)求json資源請(qǐng)求js資源。
陌離殤 回答
上面的情況都有一個(gè)共同點(diǎn),好像都轉(zhuǎn)換成了數(shù)字0了,才有打印臺(tái)的結(jié)果表現(xiàn)

顯然并不都是把start當(dāng)成0處理的....

1.先說MDN上寫了的,也就是負(fù)整數(shù)的情況。

對(duì)于start,MDN描述為:

...如果該參數(shù)為負(fù)數(shù),則表示從原數(shù)組中的倒數(shù)第幾個(gè)元素開始提取,slice(-2)表示提取原數(shù)組中的倒數(shù)第二個(gè)元素到最后一個(gè)元素(包含最后一個(gè)元素)。

也就是對(duì)于題目中arr.splice(-2, 1)的例子,提取之前arr = [9, 8, 2, 1],此時(shí)start為-2 + 4 = 3,因此行為等價(jià)于arr.splice(3, 1),結(jié)果2被抽走了,符合描述。

2.剩下的都是MDN未描述清楚的,這里要去看ECMA-262規(guī)范,這里以最新的規(guī)范做說明。

首先找到22.1.3.25 Array.prototype.splice的描述:

關(guān)于start的處理在這兩步完成,最后起作用的值是actualStart。

clipboard.png

所以第一步是把start進(jìn)行ToInteger處理:

clipboard.png

然后發(fā)現(xiàn)又進(jìn)了一個(gè)ToNumber處理....

clipboard.png

以入?yún)?code>undefined為例,首先經(jīng)過ToNumber,返回NaN;

然后根據(jù)ToInteger的第二點(diǎn),返回+0

最后根據(jù)Splice的第四點(diǎn),返回min(+0, length),也就是+0;

因此undefined作為start傳入,最后是被當(dāng)做+0處理的。

剩下的你自己分析吧...

尕筱澄 回答

@tombear 謝謝,這個(gè)文章確實(shí)不錯(cuò),改下:
index.html或其他類型的首頁

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Demo</title>
    <link rel="icon" href="/favicon.ico" mce_href="/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="/favicon.ico" mce_href="/favicon.ico" type="image/x-icon">
    <style media="screen" type="text/css">
       #appLoading { width: 100%; height: 100%; }
       #appLoading span {
            position: absolute;
            display: block;
            font-size: 50px;
            line-height: 50px;
            top: 50%;
            left: 50%;
            width: 200px;
            height: 100px;
            -webkit-transform: translateY(-50%)  translateX(-50%);
            transform: translateY(-50%)  translateX(-50%);
        }
    </style>
  </head>
  <body>
    <div id="appLoading">
       <span>Loading...</span>
    </div>
    <div id="app" style="display: none">
       <app></app>
    </div>
    <!-- built files will be auto injected -->
  </body>
</html>

App.vue中加入:

 mounted(){
        document.getElementById('app').style.display = 'block';
        document.getElementById('appLoading').style.display = 'none';
 }

OK,謝謝

這個(gè)錯(cuò)誤第二天再來 Travis-CI 上 rebuild(重新編譯)時(shí),居然意外的沒有了,一切正常,只不過 rebuild 時(shí)等待了很長時(shí)間(可能與遠(yuǎn)程服務(wù)器有關(guān)吧)。
現(xiàn)在再來思考一下昨天出現(xiàn)這個(gè)問題的原因,可能是 Travis-CI 對(duì)與非付費(fèi)用戶有限制吧。

莫小染 回答
class EncryAes
{
    static function encrypt($data,$key,$iv)
    {
        $cipher = MCRYPT_RIJNDAEL_128;
        $mode = MCRYPT_MODE_CBC;
        $data=json_encode($data);
        $encrypt_data = mcrypt_encrypt($cipher, $key, $data, $mode, $iv);
        $data= base64_encode($encrypt_data);
        return $data;
    }

    static function decrypt($data,$key,$iv)
    {
        $cipher = MCRYPT_RIJNDAEL_128;
        $mode = MCRYPT_MODE_CBC;
        $decrypt_data=base64_decode($data);
        $data = mcrypt_decrypt($cipher, $key,$decrypt_data , $mode, $iv);
        $data =rtrim($data);
        $data=json_decode($data, true);
        //$data = rtrim(rtrim($data), "..");
        return $data;
    }

    
}

更多請(qǐng)參考http://phpseclib.sourceforge.net

朽鹿 回答

@tanglijun

function imgNotFound() {
        var img = $(".popup img").get(0);
        //默認(rèn)圖片
        img.src = "http://imgs.example.com/default.png";
        img.onerror = null;
    }
function popup() {
    var target = window.location.href;
    var filename = window.location.pathname.split("/")[window.location.pathname.split("/").length - 1].split(".")[0];
    var timer = null;
    //不永遠(yuǎn)關(guān)閉彈窗
    var flag = 0;
    layer.open({
        type: 1,
        title: false,
        closeBtn: 0,
        shade: 0,
        shadeClose: true,
        anim: 0,
        skin: 'popup',
        area: ['600px', '450px'],
        time: 12000,
        resize: false,
        btn: ['不再提醒', '稍后再說', '立即了解'],
        yes: function(index, layero) {
            //按鈕【按鈕一】的回調(diào)
            //$("#layui-layer1").hide();
            //永遠(yuǎn)關(guān)閉彈窗
            flag = 1;
            layer.closeAll();
        },
        btn2: function(index, layero) {
            //按鈕【按鈕二】的回調(diào)
            //$("#layui-layer1").hide();
            //暫時(shí)關(guān)閉彈窗
            flag = 0;
            layer.close(index);
        },
        btn3: function(index, layero) {
            //按鈕【按鈕三】的回調(diào)
            //return false 開啟該代碼可禁止點(diǎn)擊該按鈕關(guān)閉
            //打開快商通
            //暫時(shí)關(guān)閉彈窗
            flag = 0;
            window.open("https://ad.example.com);
            layer.close(index);
        },
        btnAlign: 'c',
        content: '<img width="600" height="385" onerror="imgNotFound();" src="http://imgs.example.com/' + filename + '.png' + '"' + '/>',
        end: function() {
            if (flag == 1) {
                // 永遠(yuǎn)關(guān)閉彈窗
                window.clearTimeout(timer);
            } else {
                timer = setTimeout(popup, 15000);
            }
        }
    });
}
popup();

layer 是一個(gè)插件。這樣的話控制臺(tái)一直會(huì)有報(bào)錯(cuò)的可能

$("input[type='checkbox']").is(':checked')

情已空 回答

之前整理過這類問題,請(qǐng)先參考: https://zhuanlan.zhihu.com/p/...

(主要就是嘗試用canvas并且我寫了一個(gè)簡單的工具...)

如果還有問題,也歡迎進(jìn)一步交流。

病癮 回答

不知道你的每個(gè)div的長度是怎么計(jì)算的?是固定的不同的類型不同的長度?還是看里面字符串的內(nèi)容?
不管是按照什么規(guī)則制定的長度,我的理解是你把金字塔的div固定,變的只不過是里面的內(nèi)容,那么給每個(gè)內(nèi)容定義為一個(gè)對(duì)象,放到數(shù)組里,再排序,排序好了再放上去:

data = [{
   text: '性別啥哎哎',
   width: 10
}, {
   text: 'shifdsadsa哎',
   width: 12
}]
data.sort(function(a,b){
 return a.width - b.width
})

然后循環(huán)data,創(chuàng)建dom

朕略萌 回答

sign the cookie value 不是“給 cookie 賦值”的意思么……

款爺 回答

在rules寫上 exclude: /node_modules/
{

    test: /\.js$/,
    exclude: /node_modules/
  }
賤人曾 回答

beforeRouteUpdate是在重用的組件里調(diào)用會(huì)被觸發(fā)的鉤子,如果你是通過路由第一次進(jìn)行這個(gè)組件,肯定是不能觸發(fā)的。只有重用才會(huì)觸發(fā),題主最好是結(jié)合vue組件的生命周期共同處理

beforeRouteUpdate(to, from, next) {
    // 題主原有的邏輯
},
created() {
  this.ischecked = this.$route.query.type
}

還有 beforeRouteUpdate 打印 to.query.type,這個(gè)是一個(gè) String 類型
所以你后面的判斷最好應(yīng)該是:

:class = "{checked: ischecked === '1' }"

最后附上 https://router.vuejs.org/zh-c...

朕略傻 回答
// div1需要position不為static

x: Math.abs($('div2').position().top)
y: $('div2').height() - x

更新

// 原生
// 還是需要給div1設(shè)置position

x: div1.scrollTop - div2.offsetTop
y: div2.offsetHeight - x