Javascript “window.open” code won't work in Internet Explorer 7 or 8

前端 未结 2 1269
南旧
南旧 2020-12-03 12:17

I am using this chunk of jQuery/Javascript code on my site to open a popup window:

$(\'#change_photo_link\').click(function(){
    $id = $(\'#id\').attr(\'va         


        
2条回答
  •  鱼传尺愫
    2020-12-03 12:55

    The windowName argument can only contain alphanumeric characters and underscores (i.e. [A-Z0-9_]).

    You must change

    window.open("photo.upload.php?id=" + $id,"Upload Photo",
    "menubar=no,width=430,height=100,toolbar=no");
    

    to

    window.open("photo.upload.php?id=" + $id,"Upload_Photo",
    "menubar=no,width=430,height=100,toolbar=no");
    

    or some other name that doesn't have spaces.

    See https://developer.mozilla.org/En/DOM/Window.open.

提交回复
热议问题