|
查看: 974|回复: 3
|
Java Script...help
[复制链接]
|
|
|
Script #1:
<script language="javascript">
function start(){
...code for script #1...
}
window.onload=start;
</script>
Script #2:
<script language="javascript">
function init(){
...code for script #2...
}
window.onload=init;
</script>
Result:
<script language="javascript">
function start(){
...code for script #1...
}
function init(){
...code for script #2...
}
window.onload=function(){
start();
init();
}
</script
| 如果我想在trigger script2 之前先trigger script1 才work script2...我有的概念是do(script1) first ...while(script2)...可是我不懂怎样写并加入...各位可否指点小弟?。。。thx alot |
|
|
|
|
|
|
|
|
|
|
发表于 4-4-2008 10:25 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 4-4-2008 10:34 AM
|
显示全部楼层
可不可以将code for script #1 和code from script#2,一起放在一个新的function里。先跑script#1,再跑script#2?
function newFunction() {
.. code from script#1...
.. code from script#2...
}
window.onload=newFunction;
象vamp说的,加上if else来控制condition,可以更加flexible。。。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 4-4-2008 11:01 AM
|
显示全部楼层
|
其实我有两个script..script 1 (drag and drop function)..script2 ( pop up function)..我想在把file drag and drop 进basket 时先弹出popup...user在enter msg 后drag n drop function 才work..我用scripting来做到底对还是错呢?or i am going the wrong way ?。。我在这方面是新手。。请指教 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|