Saturday, 11 April 2020
Html basics-4[ Client side scripting ] or [ server side scripting]
Bunny'sBlog
April 11, 2020
Bunny Blogger
,
How to add javascript in html
,
html basics-4
9 comments
:
There are many scripting languages but most commonly used and popular scripting language is Javascript...
Q.Is it possible to add Javascript in html?
A. Yes it is ! It is mainly used in html either for client side scripting or for server side scripting
It can be inserted in html in between <script> and <script> tag before starting script one essential aspect of html is variable we'll tak a look at it...
There are certain rule we should follow before declaring variables,
Rules:-
1) They should start with alphabet
2) They should be limited upto 255 charcters
3) There should not be a blank space
4) They should not contain special symbols
5) It can contain underscore
6) Uppercase and lowercase are distinct meaning ' SUM ' and not ' sum '
var is used to declare variable in javascript
Logical operators are used to verify more than one condition at a time or to negate the condition JavaScript has 3 Logical Operators
&& [It evaluates to 'true' only when all operands are 'true']
|| [ It evaluates to 'true' when any one operand is 'false' ]
! [ It's an unary operator used to invert Boolean expression ]
Increment [++] Operator
It is used in JavaScript to increment value of variable by one
Decrement [--] Operator
It is used in JavaScript to decrement value of variable by one
syntax for if statement is
if(condition)
{
statement block;
}
If conditional statement given in parenthness is true then statements within block will be executed,followed by execution of remaining program.
b) If else statement
If the conditional expression evaluates to true then true block statements will be executed otherwise false block that is else part will be executed.either true block or false block will be executed but not both.
Note
{If you haven't seen the third part of our html series than do follow this link"https://techbunnys.blogspot.com/2020/04/html-basics-3.html"
Wanna check other blog's just click on this link ๐ techbunnys.blogspot.com ๐
So with this we have ended the html basic series i.e 4 parts i hope you found it helpful
And your feedback to me is very important so don't forget to leave a comment below.
Q.Is it possible to add Javascript in html?
A. Yes it is ! It is mainly used in html either for client side scripting or for server side scripting
It can be inserted in html in between <script> and <script> tag before starting script one essential aspect of html is variable we'll tak a look at it...
- Variables
There are certain rule we should follow before declaring variables,
Rules:-
1) They should start with alphabet
2) They should be limited upto 255 charcters
3) There should not be a blank space
4) They should not contain special symbols
5) It can contain underscore
6) Uppercase and lowercase are distinct meaning ' SUM ' and not ' sum '
var is used to declare variable in javascript
Q.What are data types?
A.Computer is used to store info and do complex calculation. JavaScript provide datatype to store different types of values according to alphabets.
1) Number Type
Number data type can hold positive as well as negative values it can hold integer and decimal point numbers which stores fractional part of number
2) String Type
It is used to store text it should be either in sngle or double quote
3) Boolean Type
It represents true or false for conditional,relational,logical operators produce boolean values true false or yes/no
4) Infinity
Division by 0 gives an special value
5) null
It means nothing or empty it is supposed to be non-existing
6) Undefined
When variable which is declared but not assigned JavaScript returns 'undefined'.
- Operators
- (Substraction)
* (Multiplication)
/ (Division)
%(Modulus)
+ Operator has 2 meanings arithmetic addition and string concatenation operator
= Assignment operator should not be 'equal to' operator
Realational operators are used to check conditions or comparisons of operands its result is Boolean value 'true' or 'false'
&& [It evaluates to 'true' only when all operands are 'true']
|| [ It evaluates to 'true' when any one operand is 'false' ]
! [ It's an unary operator used to invert Boolean expression ]
Increment [++] Operator
It is used in JavaScript to increment value of variable by one
Decrement [--] Operator
It is used in JavaScript to decrement value of variable by one
- Decision making statements
syntax for if statement is
if(condition)
{
statement block;
}
If conditional statement given in parenthness is true then statements within block will be executed,followed by execution of remaining program.
b) If else statement
If the conditional expression evaluates to true then true block statements will be executed otherwise false block that is else part will be executed.either true block or false block will be executed but not both.
Note
{If you haven't seen the third part of our html series than do follow this link"https://techbunnys.blogspot.com/2020/04/html-basics-3.html"
Wanna check other blog's just click on this link ๐ techbunnys.blogspot.com ๐
So with this we have ended the html basic series i.e 4 parts i hope you found it helpful
And your feedback to me is very important so don't forget to leave a comment below.
Subscribe to:
Post Comments
(
Atom
)
Nice and Innovative Content
ReplyDeletePlease Keep Writing
https://kamalrajputt.blogspot.com/2020/07/iPhone%2012%20no%20charger%20in%20box.html
In this blog I get a great post please also visit my blog I post a great content https://lyricsmintss.com/rat-race-babbu-maan/
ReplyDeleteThis post is really helpful as i learnt a lot . please visit https://wikilearners.blogspot.com/
ReplyDeleteShort and nice Post
ReplyDeleteHTML is must.
great knowledge
ReplyDeleteReally very happy to say,your post is very interesting to read.I never stop myself to say something about it.You’re doing a great job.Keep it up.
ReplyDeleteHtml basics-4[ Client side scripting ] or [ server side scripting]
Very Nice Post
ReplyDelete5 Internet Approval Site (Do Follow Backlinks)
Best Video
A proper kindly of research is very necessary before selecting the broker also we should keep in mind that reviews should not be trusted blindly, there should be someone who is from our friend circle who have worked with that broker FX Choice
ReplyDeleteHow To Calculate usd-to-brl. The Us Dollar Exchange Rate Often Fluctuates So Be Sure To Check Periodically.
ReplyDelete