美文网首页
Illegal invocation for `window.h

Illegal invocation for `window.h

作者: JellyL | 来源:发表于2017-09-07 23:03 被阅读62次
    const callbackOne = () => {console.log('console log callBack One');};
    callbackOne();
    // console log callBack One
    
    const callbackTwo = console.log;
    callbackTwo('console log callback Two');
    // console log callback Two
    
    const funcB = () => { return 617;}
    
    const callbackThree = () => {funcB()};
    console.log(callbackThree());
    // 617
    
    const callbackFour = funcB;
    console.log(callbackFour());
    // 617
    
    const callbackFive = () => {window.alert('callback Five');};
    callbackFive();
    // popup with 'callback Five'
    
    const callbackSix = window.alert;
    callbackSix('callback Six');
    // popup with 'callback Six'
    
    const callbackSeven = () => {window.history.back();};
    callbackSeven();
    // browser back
    
    const callbackEight = window.history.back;
    callbackEight();
    // 'Uncaught TypeError: Illegal invocation'      ?????????
    

    相关文章

      网友评论

          本文标题:Illegal invocation for `window.h

          本文链接:https://www.haomeiwen.com/subject/xyqyzttx.html