基础知识笔记小记

url地址的构成:
  • 简单了解部分内容:

    • query是地址中?开始的部分,比如http://domain.com/?search=a#hash;中,就是地址中的search字段。
    • queryStrng.parse(window.location.search),是node下方法,表示将获取到的url中的字段转换成对象,但是它不继承js中的对象的方法。
    • http://local.haitou.cc:3009/?room=27&type=1&group_id=135924,中,window.location.search的内容就是?room=27&type=1&group_id=135924;也就是query。
    • html5中全屏事件,requestFullScreen;
  • 在html中使用在html中利用WScript.Shell启用本地程序.

    if (typeof window.ActiveXObject !== "undefined") {
        var wscript = new ActiveXObject("WScript.Shell");
        if (wscript !== null) {
        wscript.SendKeys("{F11}");
    }
  • react设置元素的宽高直接refs获取去你元素,设置定位left或者top的值得时候,要获取到真实的元素。

  • jquery进行ajax骑请求,可以设置timeout的请示超时时间。毫秒:

    $.ajax({
            url: 'http://api.haitou.cc/edu/web-lesson-view',
            type: 'GET',
            timeout: 1000, //超时时间设置,单位毫秒
            data: { "id": this.state.room },
            success: function (obj_C) {
              console.log(obj_C);
              _this.setState({
                play_url: obj_C.data.play_urls
              }, ready_toplay)
            }, error: function () {
              console.log("web-lesson-view错误")
              _this.setState({
                play_url: {
                  "m3u8-raw": "http://cdn4.haitou.cc/edu/" + _this.state.room + ".m3u8",
                  "rtmp-raw": "rtmp://cdn4.haitou.cc/edu/" + _this.state.room
                }
              }, ready_toplay)
            }
          });
  • html中的canvas,中的context.setTransform(a,b,c,d,e,f);
参数描述
a水平旋转绘图
b水平倾斜绘图
c垂直倾斜绘图
d垂直缩放绘图
e水平移动绘图
f垂直移动绘图

  • 个浏览器全屏兼容方案:
     var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
  if (requestMethod) {
    requestMethod.call(element);
  } else if (typeof window.ActiveXObject !== "undefined") {
    var wscript = new ActiveXObject("WScript.Shell");
    if (wscript !== null) {
      wscript.SendKeys("{F11}");
    }
  }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值