+ 1

Is it okay to have 1 .js file for each html page?

Like 1 js file containing functions for Home page, 1 js file containing functions for About page and so on?

22nd Dec 2018, 5:03 AM
noUseForAName
noUseForAName - avatar
3 ответов
+ 1
Thanks for the quick response. Can I write it like this? for index.html: <html> <body> <script src="index.js"></script> </body> </html> for about.html: <html> <body> <script src="about.js"></script> </body> </html> for contact.html: <html> <body> <script src="contact.js"></script> </body> </html> ---------------------------- How can I link them all together in the main index file?
22nd Dec 2018, 5:19 AM
noUseForAName
noUseForAName - avatar
0
Yes you can do so and link them all together in the main index file
22nd Dec 2018, 5:08 AM
MsJ
MsJ - avatar
- 1
https://teamtreehouse.com/community/how-to-link-a-javascript-file-to-indexhtml-file If you are using php too then use include and require property to include files
22nd Dec 2018, 5:32 AM
MsJ
MsJ - avatar