3. Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
4. Scripting
• A script is a set of instructions either to the web
browser or to the server.
• Script provide changes to the webpage.
• Two type of scripting
– Sever side scripting
– Client side scripting
5. Client Side Scripting
• Client-side scripts, which run on the user’s
workstation can be used to:
Validate user inputs entered on HTML forms
Creating “cookies” that store data on user’s computer.
• The Web Browser executes the client side scripting
that resides at the user’s computer.
6. • Client side scripting cannot be used to connect to the databases
on the web server.
• Response from a client-side script is faster as compared to a
server-side script because the scripts are processed on the local
computer.
• Examples of Client side scripting languages : Javascript, VB
script, etc.
8. Client Side Languages
• Client side development is done almost exclusively
in javascript.
• The reason JavaScript is called a client side language is
because it runs scripts on your computer after you’ve loaded a
web page.
9. <html>
<head>
<script>
function fun_email()//function to validate email
{
var str_email=document.getElementById("email").value;//get the email
var emailparts=str_email.split('@');//split email from @ symbol
if (emailparts.length!=2)//if the number of parts is grater then 2 the invalid email
{
alert("Error in email address,wrong number of @");
return false;
}
var str_mailname=emailparts[0];
var str_domainname=emailparts[1];
if(str_mailname.length<1|| str_domainname.length<3)//check part length
{alert("Wrong number of character before or after @");
return false;
}
var array_chars=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w',
'x','y','z','.','0','1','2','3','4','5','6','7','8','9','_','-'];
10. for(var int_i=0;int_i<str_mailname.length;int_i++)
{
if(array_chars.indexOf(str_mailname.charAt(int_i))<0)//check the email name
{
alert("Wrong email name");
return false;
}}
for(var int_j=0;int_j<str_domainname.length;int_j++)
{
if(array_chars.indexOf(str_domainname.charAt(int_j))<0)//checking domain name
{
alert("wrong domain name");
return false;
}}
if(str_domainname.indexOf('.') == 0)//checking the index of . in domain name
{
alert("Domain must include but not start with .");
return false;
}
11. var int_len=str_domainname.length;
var DomainParts = str_domainname.split('.');//split domain name into two parts
if(DomainParts[DomainParts.length - 1].length < 2)
{
alert("Domain's last . should be 2 chars or more from the end");
return false;
}
alert("valid email id");
return true;
}
</script>
</head>
<body>
<form onsubmit="return fun_email()">
<table border=2 height=50% width=50% align="center">
<tr><td align="center">
<table width=90% height=90%>
<tr><th colspan=2><font size=6><b>Email Validation</b></font></th></tr>
<tr><td width=50% align="right"><font size=5 >Enter the Email Address</font></td>
<td><input type="text" id="email"/></td></tr>
<tr><td colspan=2 align="center"><input type="submit" align="center"
value="submit"></td></tr><tr><td colspan=2 id="result" align="center"></td></table>
</form></body></html>
12. Server side scripting
• The server is where the Web page and other content lives.
• The server sends pages to the user/client on request.
• Server-side scripting is about "programming" the behavior of
the server.
13. What can Server Scripts Do?
• Dynamically edit, change or add any content to a Web page.
• Respond to user queries or data submitted from HTML forms.
• Access any data or databases and return the result to a browser.
• Provide security since your server code cannot be viewed from
a browser.
15. The combination
A site such as Google, Amazon, Facebook or Hobowars will use
both types of scripting:
• server-side handles logging in, personal information and
preferences and provides the specific data which the user
wants (and allows new data to be stored)
• client-side makes the page interactive, displaying or sorting
data.
17. Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many contents online?
Do you want to learn things quickly?
Tired of spending huge amount of money to become a Software professional?
Do an online course
@ baabtra.com
We put industry standards to practice. Our structured, activity based courses are so designed
to make a quick, good software professional out of anybody who holds a passion for coding.
18. Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Give a feedback @ massbaab.com/baabtra
Thanks in advance
www.baabtra.com | www.massbaab.com |www.baabte.com
19. Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Cafit Square,
Hilite Business Park,
Near Pantheerankavu,
Kozhikode
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com
Contact Us
Hinweis der Redaktion
Client-side scripting is about "programming" the behavior of the browser.
the user requests a Web page from the server
the server finds the page and sends it to the user
the page is displayed on the browser with any scripts running during or after display