squiblo Posted June 10, 2010 Share Posted June 10, 2010 In the head tags of my page is have this.. <script type="text/javascript" src="http://localhost/includes/javascript.js"></script> and at the moment I am putting all the my JavaScript in that file, but that file is now becoming seriously long, and harder to read, is there a way to split the file up into many different files, to make it easier to understand and read. I have tried putting two script tags like this, but this did not seem to work. <script type="text/javascript" src="http://localhost/includes/javascript.js"></script> <script type="text/javascript" src="http://localhost/includes/javascript2.js"></script> What can I do to make it easier for myself? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/204346-js-file-help/ Share on other sites More sharing options...
haku Posted June 10, 2010 Share Posted June 10, 2010 You are better off keeping your javascript in one file, and organizing that file in a readable method. Multiple javascript files will slow down your site loading time as it requires more HTTP requests. Quote Link to comment https://forums.phpfreaks.com/topic/204346-js-file-help/#findComment-1070180 Share on other sites More sharing options...
squiblo Posted June 10, 2010 Author Share Posted June 10, 2010 That's upsetting haha, but I suppose it's for the best, thanks haku. Quote Link to comment https://forums.phpfreaks.com/topic/204346-js-file-help/#findComment-1070181 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.