js函数在控制台中获取错误

时间:2017-08-26 06:57:17

标签: javascript jquery function popup

我在控制台中收到错误:

  

avatargallery:351 Uncaught TypeError:picwin.attachEvent不是   功能       在popitpic(avatarpopup.js:11)       在HTMLAnchorElement.onclick(avatargallery:351)popitpic @ avatarpopup.js:11 onclick @ avatargallery:351

     

Uncaught SyntaxError:意外的令牌:未知

这是我的代码

/* this is the function that is used for the avatar larger images to be shown in a popup window.  */

function popitpic(url) 
{
    picwin=window.open( url,  'popwin','location=0,status=0,scrollbars=1,directories=0,resizable=0,height=250,width=250');

    if ( window.addEventListner )
    {
         picwin.addEventListener( "load", picwinload, false );
    } else {
         picwin.attachEvent( "onload", picwinload );
    }

    function picwinload( )
    {
        picwin.moveTo(0,0);
        picwin.document.body.bgColor="#100206";
    }

}//close function

0 个答案:

没有答案