Advanced Internet Technologies Part6 and 7
Advanced Internet Technologies Part6 and 7
Mariusz Zawadzki
JavaScript
JavaScript is a dynamic programming language that is
most commonly used as scripts on parts of websites.
These implementations allow client-side scripts to
interact with the user and create dynamic pages.
JavaScript is an interpreted programming language
with object-oriented functions.
The most common form of JavaScript is its client-side
(front-end) operation.
The script should be contained in or refer to an HTML
document. The JavaScript code is interpreted by the
web browser.
JavaScript
JavaScript code must be placed between the <script ...> </script>
tags on the web page.
Although JavaScript code can be placed anywhere on a web page, it
is recommended that it is placed inside the <head> section.
The JavaScript syntax is as follows:
JavaScript
In this example, document is an object referring to the current web
page, but the write() method is responsible for displaying any text.
function functionName(parameters){
// function body
}
JavaScript
JavaScript – functions
const student = {
firstName: ”Jeremy”,
lastName: ”Brown”,
studentID: 45123,
fullName: function() {
return this.firstName + ” ” + this.lastName;
}
};
JavaScript
JavaScript – objects
object constructor
JavaScript - despite its use in the name, it can actually be any scripting
language that functions on the user side (e.g. JScript or VBScript).
e.g.
To send the request to the server, the open() and send() methods of the
XMLHttpRequest object are used.
AJAX
Server Response Properties