<!DOCTYPE html><html>?? ?<head>?? ??? ?<meta charset="UTF-8">?? ??? ?<title>table表格</title>?? ??? ?<script>?? ??? ??? ?window.onload=function(){?? ??? ??? ??? ?function asdasd(){?? ??? ??? ??? ??? ?alert("123");?? ??? ??? ??? ?}?? ??? ??? ?}?? ??? ?</script>?? ?</head>?? ?<body>?? ??? ?<button onclick="asdasd()">點(diǎn)擊跳出</button>?? ?</body>運(yùn)行提示是asdasd未定義,把函數(shù)放到onload外面就能運(yùn)行了,想知道這是什么原因
js函數(shù)定義在onload中為什么提示我未定義
肖小波
2016-11-09 19:00:05