Intro to javascript

Home » Tutorials » JavaScript » Intro to javascript
Before this lesson we worked with HTML and CSS. They were constructor of our page. We learnt make responsive site. But how to make sites “smarter”? Javascript helps us with it. Nowadays in javascript developers can write server side code. There are a lot of frameworks for javascript.
Including javascript is similar to CSS including. You can include it in head section, or include as external file. For this purpose you must use <script>.  tag.

Code lesson (HTML)

<!DOCTYPE html>
<html>
<head>
	<title>Java Script</title>
	<meta charset="utf-8"/>
	<!--Подключение js в секции head-->	
	<script>
		alert("Hello world");
		console.log(1);
	</script>
</head>
<body>
	
	<!--Подключение js в конце документа-->	
	<script>
		alert("Hello world");
		console.log(1);
	</script>
	
	<!--Подключение js как внешнего файла-->	
	<script src="script.js"></script>
</body>
</html>

Code lesson (js)

alert("Hello world");
console.log(1);

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Pin It on Pinterest

Share This