Heim  >  Fragen und Antworten  >  Hauptteil

为什么函数名是window,网页就打不开了?

function window(){ //函数名为window。网页打不开
    window.open("","_blank","width=600,height=400");
}
function test(){ //函数名为test。网页打得开
    window.open("","_blank","width=600,height=400");
}
phpcn_u226phpcn_u2262832 Tage vor1273

Antworte allen(2)Ich werde antworten

  • 数据分析师

    数据分析师2017-09-30 22:51:34

    为什么函数名是window,网页就打不开了?-PHP中文网问答-为什么函数名是window,网页就打不开了?-PHP中文网问答

    围观一下哦,学习一下。

    Antwort
    0
  • 阿神

    阿神2016-12-19 09:55:17

    window不能用作函数名,window为JS关键字。

    可以在后面多加个字母来避免,比如windower。

    Antwort
    0
  • StornierenAntwort