基础知识笔记小记

来源:互联网 发布:illustrator cs6 mac 编辑:程序博客网 时间:2024/05/16 03:43

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}");    }  }}

原创粉丝点击