Published on: 03 June, 2013

Your first Javascript Example

Posted by andy | 1645 views 0 likes 0 favourites 0 comments
Tumblr Digg Google Plus

To use the Javascript is pretty straight forward. Firstly, there are two ways to use Javascript in your website.

1. Embed the Javascript codes in Html.

To embed the javascript codes, you just need to include a script tag into the html. See below example.

<script type="text/javascript">
	alert("Hello from Javascript");

2. Use external file for javascript.

To use the external file, you can just include a full script path like below.

	<script type="text/javascript" src="/js/javascriptFile.js"></script>
If you are using the second option which is external file, inside the javascriptFile.js, you do not need to include any javascript tag, which is <script type="text/javascript"></script>

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.
Related Articles
Published on: 06 January, 2018
In this tutorial, you will learn how to minify JS and CSS files using Gulp. So what is exactly a Gulp is? Gulp is a javascript task runner, it can be used to perform an automatic tasks such as minifying and bundling files, running unit tests, running code analysis and much more.