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,解释哪一行代码有语法错误。必须是其他代码!因为错误仍然存在,一定还有别的原因!因为错误仍然存在