简体   繁体   English

一个Web应用程序上有两个JavaScript

[英]Two JavaScripts on one Web App

I'm creating a web app for a charity and I have found two JavaScript functions I want to use. 我正在为慈善机构创建Web应用程序,并且发现了两个我想使用的JavaScript函数。

The first is an 'Add to Home Screen for iPhone', which I have put on my web app and works, and it can be found here: http://cubiq.org/add-to-home-screen 第一个是“添加到iPhone的主屏幕”,我已经在我的Web应用程序上放了它并可以使用,可以在以下位置找到: http : //cubiq.org/add-to-home-screen

The second script I want to use collapsible drop down buttons to hide the text that the charity want to use. 我要使用可折叠的下拉按钮隐藏慈善机构要使用的文本的第二个脚本。 I have found the JavaScript code, and I know that I to use the code below: 我找到了JavaScript代码,并且知道我要使用以下代码:

<body onload="dothat();dothis()">

<!------------SCRIPT 1-------------->
<script>
function dothis(){
"
"
"
}
</script>
<!------------END OF SCRIPT 1--->

<!-------------SCRIPT 2---------------->
<script>
function dothat(){
"
"
"
}
</script>
<!------------END OF SCRIPT 2------>

</body>

how do I use both scripts on one web app page? 如何在一个Web应用程序页面上使用两个脚本?

If they are bigger functions maybe you should link them in the html head. 如果它们是更大的函数,也许您应该将它们链接到html头中。

<script type="text/javascript" language="javascript" src="script1.js"></script>
<script type="text/javascript" language="javascript" src="script2.js"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM