Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
118 views
50 pages
Untitled
Uploaded by
Pranav Moghe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Untitled For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
118 views
50 pages
Untitled
Uploaded by
Pranav Moghe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Untitled For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Untitled For Later
You are on page 1
/ 50
Search
Fullscreen
Web Scripting CHAPTER 2 Languages University Prescribed Syllabus. JavaScript + Introduction to Seripting lan, Variable Scopes, JS Data Types, JS Functio ‘guages, Introduction to JavaScript (JS), IS Variables and Constants, JS ms, IS Array, JS Object, IS Events, Advanced JavaScript : JSON ~ ISON Create, Key-Value Pair, JSON Access, SON Array, JS Arrow Functions, JS Callback Functions, JS Promises, JS Asyne-Await Functions, JS Error Handling, AJAX: Why AJAX, Call HTTP Methods Using AJAX, Data Sending, Data Receiving, AJAX Error Handling, JQUERY : Why JQuery, How to Use, DOM Manipulation with Quer Design Using JQuery Dynamic Content Change with JQuery, UL 21. Introduction to Scripting Languages 2-3 2.1.1 Advantages of Scripting Languages 2-3 2.1.2 Application of Scripting Languages. 23 22 Introduction to JavaScript 2:3 221 Features of JavaScript 24 222 Applications of JavaScript 24 22:3 Characteristics of JavaScript 24 22.4 Advantages and Disadvantages of Client- Side Scripting 24 228 Differences between Client Side and Server Side Scripting Language 25 22.6 Using JavaScript in an HTML Document. 25 22.7 JavaScript Example 25 23 JavaScript Variables and Constants, 26 23.1 Variables 126 2.3.2 JavaScript Constants 27 24 JS Variable Scopes. 27 25 JS Data Types 29 28 JS Functions: 2-10 281 Function Definition m0 262 Defining Function Arguments. any 263 Defining a return statement. 244rt (SPPU-Sem 6-7) 27 JS Arey 27.1, Derent ways 1 create an AY 23 Array Methods: Inerating Through an Array ao Daieting Element from an Arey ae Array Method Spioe() “ pe JaveaSonst Onects ™ 281 Creating Otyects in JavaSerOt es ay 282 Sting Object 283 Regexp Odyect - . 254 Math Odject 285 Date Object 286 Number Object 287 Array Object 29 JS Events 2.10 Advanced JavaSonpt: JSON 2.11. JSON Data Types 2.12 JSON Object 2.13. JS Arrow Functions 2.14 JS Caliback Functions 2.18 JaveSorit Promise 2.16 JS Asyne-Awalt Functons 2.17 JS Error Handing. 218 AJAX. sre 2.18.1 Asynchronous in AJAX 2.18.2 Benefits of Ajax 2183 2184 2.18 AJAX Design Bases = 219.1 AJAX Processing Steps 220 Call HTTP Methods Using AJAX 221 AJAX Error Handling 2.22 JQUERY 2201 Features of jQuery 2222 — Loading jQuery. 2223 Selecting Elements 223 DOM Manipulation wit JQuery 2.23.1 Changing Styles 2.732 — Creating and Appending Elements 2.233 Removing Elements 2.24 Dynamic Content Change with JQuery, 2.25 UI Design Using Jquery Chapter Ends (New Syllabus wef academic year 2021-22) (6-57) HIN oan 5 fl Tech-Neo Publications .A SAC\ web Application Development (SPPU-Sem 6-1) (ihsb Govtoang Languages) Pg. Noi (2-3 ———_—— -1_ INTRODUCTION TO SCRIPTING » LANGUAGES amming languages The scripting language is basically a language where instructions are written for a nun time environment. They do ot roquite the compilation step and are rather interpreted. It tings ew functions to applications and glue complex system together. A scripting language is a programming language designed for integrating and communicating with csher programming languages. ‘There are many scripting languages some of them are discussed below 1, Bash : It is a scripting language to work in the Linux interface. It is a lot easier to use bash to create scripts than other programming languages. It describes the tools to use and code in the command line and create useful reusable scripts and conserve documentation for ther people to work with. 2 Node js : It is a framework to write network applications using JavaScript. Corporate users of Node,js include IBM, LinkedIn, Microsoft, Netflix, PayPal, Yahoo for real-time web applications. 3. Ruby : There are a lot of reasons to leam Ruby programming language. Ruby's flexibility has allowed developers to create innovative software. It is a scripting language which is great for web development. 4. Python : It is easy, free and open source. It supports procedure-oriented programming and object-oriented Programming. Python is an interpreted language with éynamic semantics and huge lines of code are scripted and is currently the most hyped language among evelopers S. Perl : A scripting language with innovative features to ‘make it different and popular. Found on all windows ‘and Linux servers, It helps in text manipulation tasks. High traffic websites that use Perl extensively include Priceline.com, IMDB. °S 2.1.1 Advantages of Scripting Languages (1) Easy learning : The user can lear to code in scripting languages quickly, not much knowledge of web technology is required (2) Fast editing : It is highly efficient with the limited ‘umber of data structures and variables to use. (3) Interactivity: 1 helps in adding faces and combinations in web pages. Modern web Pages demand the use of scripting languages. To create enhanced web pages. visualization fascinated visual description, Which includes background and foreground colors and (4) Functionality : There are different libraries which are part of different scripting languages. They help in creating new applications in web browsers and are different from normal programming languages. 2.1.2 Application of Scripting Languages Scripting languages are used in many areas: 1. Scripting languages are used in web applications. It is used in server side as well as client side. Server side scripting languages are: JavaScript, PHP, Perl etc. and client side scripting languages are: JavaScript. AJAX. JQuery ete 2. Scripting languages are used in system administration For example: Shell, Perl, Python scripts etc. 3. _Itis used in Games application and Multimedia. 4. It is used to create plugins and extensions for existing applications. 1_2.2__ INTRODUCTION TO JAVASCRIPT GQ. Write a short note on JavaScript. 7 © JavaScript isa light-weight object-oriented programming language which is used by several websites for scripting the webpages. ‘© JavaScript was developed by Mr. Brendan Eich in 1995 who was working in Netscape. © JavaScript is not a compiled language, but it is a translated language. © The JavaScript Translator (embedded in the browser) is responsible for translating the JavaScript code for the web browser. + Its an interpreted, full-fledged programming language that enables dynamic interactivity on websites when applied to an HTML document ‘© JavaScript helps to make our webpage more lively and imeractive. JavaScript is widely used in mobile application development as well as in game development ‘© JavaScript was initially called as LiveScript and later oon the name is changed to JavaScript (New Syllabus wes academic year 2021-22) (P6-57) Talrecn Neo Pubicatons A SACHIN SHAH Verne0 PO.No. (24 Web Application Development (SPPI Sin) fr input is validated before ing th he Page © With JavaScript, users can build modern web a wer This minimizes the server wane o applications to interact directly without reloading the set ewer Toads on the server ich page every time. The traditional website uses JS (© provide several forms of interactivity and simplicity 2.2.1 Features of JavaScript ‘The features of JavaScript areas follows’ 1. All popwlar web browsers support JavaScript as they provide built-in execution environments 2. JavaScript follows the syntax and structure of the C programming language, Thus, it is a structured programming language. 3. JavaScript is a weakly typed language, where certain types are implicitly cast (depending on the operation 4. JavaScript is an object-oriented programming langu that uses prototypes rather than using classes for inheritance. Iti a light-weighted and interpreted language. Iis a case-sensitive language. JavaScript is supportable in several operating systems including Windows, macOS, ete. 8. It provides good control to the users over the web browsers ‘YS 2.2.2 Applications of JavaScript JavaScript is used (0 create interactive websites. It is ‘mainly used for: Client-side validation, Dynamic drop-down menus, Displaying date and time, Displaying pop-up windows and dialog boxes (like an alert dialog box, confirm dialog box and prompt dialog box), 5. Displaying clocks, ete. 2.2.3. Characteristics of JavaScript 1. JavaScript is a lightweight, interpreted client-side scripting language. 2. Designed for developing network-based applications. 3. JavaScript is complementary to Java, 4. JavaScript is complementary to and integrated with HTML. I is an open source and cross-platform, 3. May need more time and effort for develop scripts are not already available thr resources 4 (New Syllabus we f academic year 2021-22) (P6-57) (Web Scripting Languages) 7. Thais monet fre ETOWAH SE ong has been forgotten to enter nerve iterfaes cam Be STEEL, Which cay 9, responses to end User actions HIKE MOUSE oF faye ‘ ar tivities 9, JavaScript cam include elements lke dap ga, components and sliders (0 provide a feel of gcp interface to the users. ys 2.2.4 Advantages and Disadvantages of Client- Side Scripting TGQ.” “What are the advantages and disadvanta 1 cient side scripting? E Advantages of Client- Side Scripting 1. Immediate response to a user's actions which, more interactivity No need to go to the server: hence, execution is f Improve the usability of web sites for users browsers support scripts, 4. Developers get_more control over the look behaviour of their web widgets, 5. Possible to substitute by HTML if a user's browsers ‘not support scripts. 6. Are reusable and obtainable from various types of resources. Disadvantages of Client- Side Scripting |. Scripts are not supported by all of the browsers he errors might occur if no alternatives have provided. ‘There is need of more quality assurance te different browsers and browser Versions SUP dierent Sometimes, the web widget looks i ‘control, but their behaviour may be diff Yersa, which may lead to usability problet e) Badrecnneo Publications A SACHIN.web Apoication Development (SPPU-Som 6-17) ferences between Client Side and Server Side Scripting Language GR What are the server side scripting language? we 22. Client Side Scripting Language The client side script is executed by web browser which is located at the user's ‘computer. Server Side Scripting Language ‘The server side script is executed by the Web Server ‘outputs Which is to be sent to the browser. Client side scripting language cannot connect tthe databases which is located on the web server. Taba Server side seripting language can connect and access to the databases which is, located on the web server. Client side scripting language cannot have access to the file system which is located on the web File System Server side seripting language has access to the file system which is located on the web server. Samet we sabi | poate perme Caer Client side scripting language can access the files and settings that are local at the user's computer. ‘Access to Setting User cannot block the Server side scripting language Response from a server-side script slow since the scripts are processed on the remote computer. PHP, JSP, ASP, ASP.Net, Ruby, Perl, etc. User can block the Client side scripting language Response from a client-side script is quick since the seripts are processed on the local computer. JavaScript, VBScript, ete. Examples 6 Using JavaScript in an HTML Document * The code (script) of JavaScript is written in the script ‘opening HTML tags in a web page. Usually, the © The W. 2.2.7 JavaScript Example > 1. Embedded JavaScript ‘The JavaScript code can be embed into a HTML file using the
tag
JavaScript
document.write ‘This method writes a string into HTML document. Teal rech-Neo Pubications.A SACHIN SHAH VentureWeb Application Development (SPPU-Sem 6.11) Output © 0 msn i c File | CAkersvAdminyDesktoprsamplet hint Weloome To JavaScript In the above program, outside the syavsSeript”sro="MyFileje'>
Welcome to JavoSeript