I think we have to know about the user experience.That means now i'm going to write about the user interface.Coding in the front-end of application known as user interface,in scripting language we have to encoded our code by < script > tag.
In css we have to encode by this:
Now I'm going to discuss about some basic javascript coding.
Write to the Document with JavaScript
we can also add an external script page in our main page by this way:
< script type="text/css">< /script >And in javascript we have to encode by this:
< script type="text/javascript" >< /script >Usually this kind of script works when browser load the page or depending user actions. So that it's called client side language.
Now I'm going to discuss about some basic javascript coding.
Write to the Document with JavaScript
document.write("My First JavaScript coding");Change HTML elements with JavaScript
document.getElementById("demo").innerHTML="My First JavaScript";Here "domo" is the id of any HTML elements.
we can also add an external script page in our main page by this way:
<script src="myScript.js"></script >One more thing I'm telling you that there is an alternative way to write script using Jquery. for this we need to add a script at the beginning of the root html file. also you can download this jquery file from this link: Jquery Link and set it to your local folder and embed it as like this:
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>The jQuery API has a number of hosts that have recent and up-to-date versions:
- http://code.jquery.com/jquery-latest.min.js - Most recent version, jQuery hosted
- http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js - Version 1.x family, Google hosted
- http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js - Version 1.9.1 family, Google hosted
- http://ajax.microsoft.com/ajax/jQuery/jquery-1.9.1.min.js - Version 1.9.1, Microsoft hosted