简体   繁体   中英

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.

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

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:

<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?

If they are bigger functions maybe you should link them in the html head.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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