[英]javascript function reports issue missing semicolon, what is the error?
I have a very simple function, yet it gives the statement "missing semicolon".我有一个非常简单的 function,但它给出了“缺少分号”的语句。
The code is as follows:代码如下:
window.onload = function () {
var title = document.getElementsByTagName("title")[0].innerHTML;
document.getElementsByTagName("H1")[0].innerText = title;
}
What am i missing here?我在这里想念什么?
you have missing the semicolon at end你最后缺少分号
window.onload = function () {
var title = document.getElementsByTagName("title")[0].innerHTML;
document.getElementsByTagName("H1")[0].innerText = title;
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.