加载页面然后执行javascript

时间:2014-09-23 18:14:32

标签: javascript powershell

我需要一种在启动时自动启动URL的方法,然后一旦url加载了调用页面函数

而且我不知道如何处理这个问题,我想不出一种方法可以通过powershell来做到这一点我不知道任何其他语言任何帮助将更加如此,如果它是为一个5岁的年轻人写的

2 个答案:

答案 0 :(得分:1)

我不确定我是否正确理解......但也许你看起来像这样:

<html>
<head>
</head>
<body>
<!-- Put your html here -->
....
....
....

<!-- Scripts the bottom of the page -->
<script>
startup_function();

function startup_function(){
alert('Hello');
}
</script>
</body>
</html>

答案 1 :(得分:0)

请在html之后将您的javascript文件保存在正文中。并使用

window.load();