gpt4 book ai didi

javascript - 未捕获的语法错误 : missing ) after argument list3

转载 作者:行者123 更新时间:2023-12-01 03:08:54 25 4
gpt4 key购买 nike

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();

最佳答案

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

您错过了提醒中的“+”。

关于javascript - 未捕获的语法错误 : missing ) after argument list3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45973836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com