I have recently developed my first mobile web application using HTML5, CSS3, JavaScript and a bit of jQuery. At this stage I want to separate codes for HTML, CSS & JS in 3 different files and using a web server to establish connection between those files. Any solution?
Just declare references to your CSS & JS from within your HTML. For performance reasons, it's good to put the CSS reference in the head, and the JS reference at the end of the file just before closing out the tag. That way, your page will load and will look correct right off the bat and won't be blocked downloading the JavaScript. The JS will be the last thing to load. Here's an example of the HTML markup:
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyles.css" />
</head>
<body>
...
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="myscript.js"></script>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With