例如,我这里有这个 javascript 函数:
<script type="text/javascript">
function onLoadFunctions() {
//some funcitons here...
}
</script>
我想在页面加载时仅使用 javascript 加载此函数。 谁能帮我。提前致谢。
最佳答案
如果我理解您的问题,您可能想使用 window.onload
。
<script type="text/javascript">
function onLoadFunctions() {
//some funcitons here...
}
window.onload = onLoadFunctions;
</script>
关于javascript - 在开始使用 javascript 时加载 javascript 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19322435/