zoukankan      html  css  js  c++  java
  • 安卓 微信 input file change无效 调试

    最近公司在做一个活动需要做一个网站,还需要移动端能访问。

    有个上传图片的功能在andriod微信里面没有反应,而在QQ和普通浏览器都是正常的。

    顿时就无语了,想着手机web怎么调试呢?于是在网上找到了AlloyLever(http://alloyteam.github.io/AlloyLever/)。

    一、alloylever的安装和使用

    1、alloylever安装

    npm install alloylever

    2、引入alloy-leve.js

    <script src="/themes/js/alloy-leve.js"></script>

    3、添加配置

    <script>
    
    AlloyLever.config({
            cdn:'//s.url.cn/qqun/qun/qqweb/m/qun/confession/js/vconsole.min.js',
            reportUrl: "//a.qq.com",
            reportPrefix: 'abc',
            reportKey: 'msg',
            otherReport: {
                uin: 100000
            },
            entry:"#entry"
        })
    
    </script>

    //AlloyLever会监听window.onerror并把错误信息保存下来,并且上报到reportUrl,你也可以召唤到vConsole并显示出来错误和相关日志。


    4、url唤起vConsole

    只要你的页面引用了AlloyLever,你只需要在你的url里带上 vconsole=show 就能显示vConsole面板。如:

    http://localhost:63342/AlloyLever/index.html?vconsole=show

    经过调试发现是input绑定的change事件无效。

    <input id="fileImage" type="file" accept="image/*"/>

    后经查询需要加上capture="camera"属性。

    <input id="fileImage" type="file" accept="image/*;capture=camera"/>

    经过测试,正常了!!!

     
  • 相关阅读:
    优化页面响应时间
    php性能优化
    加快compser install 和update的方法
    好用的类库
    php会话(session)实现原理
    mysql引擎
    数据库事物四大特性
    数据库索引
    insert和insertSelective区别
    java面试题之int和Integer的区别
  • 原文地址:https://www.cnblogs.com/java-chanjuan/p/8038296.html
Copyright © 2011-2022 走看看