鍍金池/ 問答/ HTML問答
小眼睛 回答

如果你每次執(zhí)行app()互相沒有聯(lián)系 可以放在一個(gè)數(shù)組里 用Promise.all來執(zhí)行

let p =[]
for(let i=0;i<data.length;i++){
  p.push(app(i,data))
}
Promise.all(p).then(res=>{
  console.log(res)
})
來守候 回答

具體邏輯沒看,但if($(".icon-one"))這種寫法肯定是不對(duì)的,因?yàn)?code>$(".icon-one")返回的是個(gè)jQ對(duì)象,自動(dòng)轉(zhuǎn)換為true,這樣上邊的分支實(shí)際就變成常通了。
這種一般是要在事件回調(diào)中用到$(this),這個(gè)是jQ對(duì)e.target的一個(gè)封裝(相當(dāng)于$(e.target)),它返回的是jQ封裝的事件被觸發(fā)的那個(gè)DOM對(duì)象,而判斷是否包含一個(gè)類,則可以用.is()這個(gè)API。簡(jiǎn)而言之,寫成if ( $(this).children().is(".icon-one") )吧。

殘淚 回答

這樣就已經(jīng)傳進(jìn)去了,關(guān)鍵是你怎么取的問題

aId = this.props.history.params.aId
情皺 回答

圖片描述

隨便找個(gè)瀏覽器,調(diào)試一下document.getElementsByTagName('span'),里面有個(gè)style屬性,自己看

蝶戀花 回答
  1. jsonp需要服務(wù)端配合才可以
  2. 微信不推薦在瀏覽器端獲取access_token,會(huì)帶來以下問題:

    1. 每個(gè)瀏覽器打開之后都會(huì)獲取一次,用戶量一多,該API由于超過調(diào)用次數(shù)被微信停掉
    2. appid和secret泄漏
    3. 無法統(tǒng)一緩存access_token
情皺 回答
Calling the next() method with an argument will resume the generator function execution, replacing the yield expression where execution was paused with the argument from next().
from: https://developer.mozilla.org...

就是說,如果你調(diào)用next方法時(shí)附帶了參數(shù)的話,generator會(huì)繼續(xù)執(zhí)行,直到下一個(gè)yield時(shí)停止,這是會(huì)把yield表達(dá)式換成傳入的參數(shù)。

疚幼 回答

H5 只會(huì)提供坐標(biāo)值給你,如果想要獲取精確的省市區(qū)位置,可以使用百度、高德的 api 去獲取。注意瀏覽器權(quán)限,原生的 geolocation 是無法在 http 下生效的,只能在 https 有效果。

夏夕 回答

上面的你們?cè)搶弻忣}了,題主是在vue中使用 JSX 語法,他的綁定方法是對(duì)的。https://cn.vuejs.org/v2/guide...
應(yīng)該是onMousedown,而不是onMouseDown,不存在mouseDown這個(gè)事件。

擱淺 回答

1

//var VueRouter = require ('vue-router')
import Router from 'vue-router'
//Vue.use (VueRouter)
Vue.use(Router)
是否use 

2 這個(gè)this.指向什么 倆個(gè)方向排查

獨(dú)白 回答

你這個(gè)寫法還有問題,影響性能。

function getInfo(page) {

$.ajax({
    type: 'post',
    url: '/web/illegalMessages',
    //dataType:'json',
    data: {
        'page': page
    },
    async: false,
    success: function(data) {

        //var data = JSON.parse(data);
        var list = data.data;
        totalRow = data.totalRow; //獲取總條數(shù)

        if (data.flag == 'success') {

            $('tbody').html(''); //先清空,否則再次查詢會(huì)在本頁累加數(shù)據(jù)
            var _html = "";
            for (var i = 0; i < list.length; i++) {
                var num=i+(page-1)*10
                _html += '<tr id="' + list[i].illegalmessageid + '">' +
                    '<td>' + num + '</td>' +
                    '<td>' + list[i].occurarea + '</td>' +
                    '<td>' + list[i].platenumber + '</td>' +
                    '<td>' + list[i].occurtime + '</td>' +
                    '<td>' + list[i].markImgPath + '</td>' +
                    '<td>' + list[i].detailImgPath + '</td>' +
                    '<td>' + list[i].voicePath + list[i].videoPath + '</td>' +
                    '<td>'+
                    '<a href="javascript:;">'+
                     list[i].deal + 
                     '</a>'+
                     '</td>' +
                    '</tr>'
            }
            $('tbody').append(_html);
        }


        //配置并加載所需模塊
        layui.config({
            base: 'base/lay/modules/'
        }).use(['laypage', 'table'], function() {
            var laypage = layui.laypage;
            var table = layui.table;

            //實(shí)例化分頁
            laypage.render({
                elem: 'layPage' //分頁容器的id
                    ,
                layout: ['prev', 'page', 'next', 'limits', 'count'] //排版
                    ,
                limit: 10 //每頁顯示數(shù)
                    ,
                count: totalRow //總條數(shù)
                    ,
                curr: page //當(dāng)前頁
                    ,
                groups: 3 //連續(xù)出現(xiàn)的頁數(shù)
                    ,
                theme: '#1E9FFF' //自定義選中色值
                    ,
                skip: true //開啟跳頁
                    ,
                jump: function(obj, first) { //點(diǎn)擊頁碼跳頁
                    if (!first) {
                        $('tbody').html('');
                        getInfo(obj.curr); //查詢,傳參:當(dāng)前頁
                    }
                }
            });
        });

    },
    error: function(XMLHttpRequest, textStatus, errorThrown) {
        console.log(XMLHttpRequest.status);
        console.log(XMLHttpRequest.readyState);
        console.log(textStatus);
    },
})

}

$(function() {

//存儲(chǔ)id到會(huì)話并且跳轉(zhuǎn)頁面

$('tbody a').unbind('click').on('click',function(){

    var id=$(this).parents('tr').attr("id");

    sessionStorage.setItem('id',id);

    $(this).attr("href","../Illegal_honking/Illegal_honking.html");

})

})

不將就 回答

H5還能怎么實(shí)現(xiàn)……要么是模擬實(shí)現(xiàn),要么你直接把這個(gè)需求懟回去。。。

悶油瓶 回答

這個(gè)地方復(fù)制粘貼就行了 這個(gè)地方有很多,復(fù)制粘貼就行了

冷溫柔 回答

你應(yīng)該先去看看 http 協(xié)議:典型的 HTTP 會(huì)話
一次 http 會(huì)話先由客戶端(瀏覽器)發(fā)起請(qǐng)求,然后服務(wù)器收到請(qǐng)求之后,根據(jù)請(qǐng)求內(nèi)容返回客戶端想要的數(shù)據(jù),叫響應(yīng)。
一個(gè)請(qǐng)求由請(qǐng)求頭、請(qǐng)求正文等組成,urlget/post這些屬于請(qǐng)求頭的部分,請(qǐng)求正文就是你re.send方法發(fā)送的數(shù)據(jù)。
服務(wù)器收到請(qǐng)求后返回的響應(yīng)同樣有響應(yīng)頭、響應(yīng)正文,例如你re.status的值其實(shí)就是響應(yīng)頭里的 HTTP 狀態(tài)碼,re.responseText就是響應(yīng)正文。
為什么你會(huì)收到整個(gè)http.html頁面,這是因?yàn)榉?wù)器返回的響應(yīng)正文就是整個(gè)http.html頁面,跟你 send 過去的東西沒有任何關(guān)系。
如果你想收到的 send 過去的東西,你需要在服務(wù)器的代碼里進(jìn)行處理,讓服務(wù)器返回你想要的響應(yīng)內(nèi)容。

喵小咪 回答

let Event = new Vue();

// 監(jiān)聽
Event.$on('xxx', function (a) {});

// 觸發(fā)
Event.$emit('xxx', a);

孤慣 回答

看注釋

for (n = 0; n<8; n++){
        //在頁面中創(chuàng)建canvas
        var oCan = document.createElement('canvas');
        $("#div1").append(oCan);
        var context=oCan.getContext("2d");
        oCan.innerHTML = '<img src="'+ imgSrc[n]+ '" alt=""/>'; //這里是干什么用????
        //imgSrc為一個(gè)圖片src的數(shù)組。
        //添加圖片
        var image = new Image();
        image.src = imgSrc[n];
        console.log(image);
        image.onload = function () {
            var imgHeight = this.height;
            var imgWidth = this.width;
            imgWidth=oCan.width;
            imgHeight=oCan.height;
            context.drawImage(image, 0, 0,imgWidth,imgHeight); //你把圖片始終畫在0,0位置,所有圖片全覆蓋在一起了
            var imageData =context.getImageData(0, 0, imgWidth, imgHeight);
            console.log(imageData.data);
         }      
愛礙唉 回答

媒體查詢


@media only screen and (device-width: 375px) and (device-height: 812px){
  // 你的樣式
    }
    
淚染裳 回答

App.vue組件