Client side and server side scripting
-
Upload
baabtracom-first-coding-school-in-india -
Category
Technology
-
view
520 -
download
4
description
Transcript of Client side and server side scripting
Sreya chandran [email protected]
mwww.facebook.com/sreyatwitter.com/usernamein.linkedin.com/in/
profilename
Client Side And Server Side Scripting
Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
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
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.
• 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.
The process with client-side scripting
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.
<html><head><script>function fun_email()//function to validate email{var str_email=document.getElementById("email").value;//get the emailvar emailparts=str_email.split('@');//split email from @ symbolif (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','_','-'];
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; }
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>
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.
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.
The process with server-side scripting
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.
THANKYOU
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.
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
Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
Cafit Square,Hilite Business Park,Near Pantheerankavu,Kozhikode
Start up VillageEranakulam,Kerala, India.Email: [email protected]
Contact Us