Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Sunday, 23 October 2011

JAVA SCRIPT: Variables, Operators, Statments, Loops

JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a mulch-paradigm language, supporting object-oriented, imperative, and functional programming styles.

JavaScript was formalized in the ECMAScript language standard and is primarily used in the form of client-side JavaScript, implemented as part of a Web browser in order to provide enhanced user interfaces and dynamic websites. This enables programmatic access to computational objects within a host environment.

<html>
<head>
<script type="text/javascript">
function displaydate()
{
document.getElementById ("demo").innerHTML=Date();
}
</script>
</head>
<body>

<h1>My first Javascript</h1>
<p id="demo">this is a paragraph.</p>

<button type="button" onclick="displaydate()">Display Date</button>

</body>
</html>
For short comment : // and comment & for long comment /* and long comment and closed to */

Java Script Variables :
A variables is when java script keep information. the two types of variable ---
  1. Local
  2. Gobble
In Java Script without declaration you can use a variables
Var x;
---------- declare variable
x=27;
-------------
y = 34;  No declaration

JAVA SCRIPT Operators : 
Modulus :
+
-
/
%
++          Inc by,
--            dis by,


 =                               x = y
+=                              x+ =y                    x = x+y
-=                               x-= y                     x = x-y
*=                              x* = y                    x = x*y
/=                              x/ = y                     x = x/y
%=                           x% =y                    x = x%y
Text1           =           " is in";
Text2           =           " Agra";
Text3           =           "Taj Mahal";
Text4           =           Text3+Text1+Text2 


Wednesday, 17 August 2011

Basic HTML

HTML
HTML is acronym for hypertext markup language. It is standardized for tagging text files achieving font, color,graphics (images), link and effects on the www (world wide web ) pages. We can display all the thing through tags, attributes, elements.

Tags:- Tags is a simple text character used to identify text on the web page.e.g. <>less then and greater than these sign is known as tags.

Attributes:- which identify the format of the tag you want to apply on the web page. e.g. <p> it is use to make a paragraph.

Element:- In which tag we show the format code start and end is known as element.

Note:- HTML coding is written in the note pad file.

BASIC STRUCTURE OF HTML:-

<HTML> = This is the identification of yours file in which you program is written.

<HEAD>
<title> = If you type anything between the title tags it will show on the title bar of your browser and title tags is also written between the need tags. </title>
</HEAD>

<body> = All the contents written in the body tags shows on your browsers page. </body>
</HTML> = this is the closing of your tags. two types of tags are used to creat web page.
(1) Single tags
(2) Paired tags.
(1) Single tags: Single tag will only start like <p>, <br> etc.
(2) Paired Tags: Paired tags start and end both tags are compulsory to show its cont.. e.g. <b>.......</b>, <i>.........</i> etc.

How to write a HTML Program
click on start - program- accessories-notepad or start- run- type "notepad" in the box- ok
Type the structure of the HTML codes in the notepad.
<html>
<head>
<title>your title</title>
</head>
<body>type your contant</body>
</html>
file- save- type the name of the file with the extension e.g. siss.HTML-save-double click on your browser-file-open-browse-select file where you saved-open-OK

All the contants of that file will show in your browser.

Basic HTML Stretcher  


(source by faizan jamal)