Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/410.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未捕获的语法错误:缺少)在参数列表3之后_Javascript - Fatal编程技术网

Javascript 未捕获的语法错误:缺少)在参数列表3之后

Javascript 未捕获的语法错误:缺少)在参数列表3之后,javascript,Javascript,传递到窗口。onload不是函数的结果,而是函数的参考,并在警报消息中添加遗漏的+ var yourName; //global variable accessible to all functions function showAnotherMessage() { alert("Hi " + yourName ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript fil

传递到
窗口。onload
不是函数的结果,而是函数的参考,并在警报消息中添加遗漏的
+

var yourName;   //global variable accessible to all functions
function showAnotherMessage() {
    alert("Hi " + yourName  ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript file");
}

function init() {
    yourName = Prompt("Hi. Enter your name.\nWhen the browser window is first loaded\nthe function containing this prompt window is called.", "Your name");
    clickme = document.getElementById("clickme");
    clickme.onclick = showAnotherMessage;

    }

window.onload = init();
参考文献


window.onload=init

传递到
窗口。onload
不是函数的结果,而是函数的参考,并在警报消息中添加错过的
+

var yourName;   //global variable accessible to all functions
function showAnotherMessage() {
    alert("Hi " + yourName  ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript file");
}

function init() {
    yourName = Prompt("Hi. Enter your name.\nWhen the browser window is first loaded\nthe function containing this prompt window is called.", "Your name");
    clickme = document.getElementById("clickme");
    clickme.onclick = showAnotherMessage;

    }

window.onload = init();
alert("Hi " + yourName + ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript file");
参考文献

window.onload=init

alert("Hi " + yourName + ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript file");
您的警报中缺少一个“+”


您的警报中缺少一个“+”。

您的警报串联中缺少一个
+

alert(“Hi”+yourName+”\n这是一条警报消息,\n不再在HTML中定义,而是在JavaScript文件中定义”)

在警报连接中缺少一个
+

alert(“Hi”+yourName+”\n这是一条警报消息,\n不再在HTML中定义,而是在JavaScript文件中定义”)

缺少连接。 提示应为小写

function showAnotherMessage() {
    alert("Hi " + yourName + ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript file");
}

您缺少一个连接。 提示应为小写

function showAnotherMessage() {
    alert("Hi " + yourName + ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript file");
}

如果问题仍然存在,则与调用函数有关

var yourName;   //global variable accessible to all functions
function showAnotherMessage() {
    alert("Hi " + yourName + ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript file");
}

function init() {
    yourName = prompt("Hi. Enter your name.\nWhen the browser window is first loaded\nthe function containing this prompt window is called.", "Your name");
    clickme = document.getElementById("clickme");
    clickme.onclick = showAnotherMessage;

    }

window.onload = init();

如果问题仍然存在,则与调用函数有关

var yourName;   //global variable accessible to all functions
function showAnotherMessage() {
    alert("Hi " + yourName + ".\nThis is an alert message is no longer defined\nin the HTML but in a JavaScript file");
}

function init() {
    yourName = prompt("Hi. Enter your name.\nWhen the browser window is first loaded\nthe function containing this prompt window is called.", "Your name");
    clickme = document.getElementById("clickme");
    clickme.onclick = showAnotherMessage;

    }

window.onload = init();

请显示a,解释哪一行代码有语法错误。请显示a,解释哪一行代码有语法错误。必须是其他代码!因为错误仍然存在,一定还有别的原因!因为错误仍然存在