小编bru*_*ber的帖子

制作"宏"命令来运行程序

我有一个Main.java文件,我想运行程序传递test.txt

我知道在命令行中我可以编写javac Main.java

编译后我可以写java Main test.txt,这将完成运行文件和传递test.txt

如果我想要能够只是编写main test.txt并拥有触发器,我的Main.class文件就可以运行,如果是这样的话,怎么样?

java command-line

5
推荐指数
1
解决办法
895
查看次数

如何附加到window.onload?

我有一个函数,foo我想添加,window.onload但我的问题是已经有另一个函数bar,设置为window.onload.如何附加两个功能.我没有权限改变bar添加的逻辑,window.onload因此我无法使用范例addEvent(…).在所有情况下都会像以下一样工作吗?

<script>
$(window).load(foo(){
//my code here
});
</script>

//lots of html
//potentially this happens before or after my above script

<script>
window.onload = bar();
otherFunction(){
//other function code here
};
</script>
Run Code Online (Sandbox Code Playgroud)

html jquery

2
推荐指数
1
解决办法
2403
查看次数

标签 统计

command-line ×1

html ×1

java ×1

jquery ×1