UNIT 3
UNIT 3
(314453)
UNIT NO. 03
Web Scripting Language
Syllabus : Unit 2: Web Scripting
Language
JavaScript: Introduction to Scripting languages, Introduction to JavaScript
(JS), JS Variables and Constants.
AJAX: Why AJAX, Call HTTP Methods Using AJAX, Data Sending, Data
Receiving, AJAX Error Handling.
6
• Can be used as object-oriented language
• Client-side technology
• Embedded in your HTML page
• Interpreted by the Web browser
• Simple and flexible
• Powerful to manipulate the DOM (Document Object Mode)
JavaScript
Advantages
• JavaScript allows interactivity such as:
• Implementing form validation
• React to user actions, e.g. handle keys
7
• Changing an image on moving mouse over it
• Sections of a page appearing and disappearing
• Content loading and changing dynamically
• Performing complex calculations
• Custom HTML controls, e.g. scrollable table
• Implementing AJAX functionality
What Can JavaScript
•Do?
Can handle events
• Can read and write HTML elements
• Can validate form data
• Can access / modify browser cookies
8
• Can detect the user’s browser and OS
• Can be used as object-oriented language
• Can handle exceptions
• Can perform asynchronous server calls
(AJAX)
JavaScript
Syntax
• JavaScript can be implemented using <script>... </script> HTML
tags in a web page.
• Place the <script> tags, within the <head> tags.
• Syntax:
• <script language="javascript" type="text/javascript">
• JavaScript code
• </script>
JavaScript
Syntax
• Example:
<html>
<body>
<script language="javascript" type="text/javascript">
<!--
document.write("Hello World!")
//-->
</script>
</body>
</html>
• The comment ends with a "//-->". Here "//" signifies a comment
in JavaScript
• Output
Hello World!
JavaScript
Syntax
The JavaScript syntax is similar to C# and Java
• Operators (+, *, =, !=, &&, ++, …)
• Variables (typeless)
12
• Conditional statements (if, else)
<body>
20
<script type="text/javascript">
alert('Hello JavaScript!');
</script>
</body>
</html>
Another Small
Example
small-example.html
<html>
<body>
<script type="text/javascript">
21
document.write('JavaScript rulez!');
</script>
</body>
</html>
Using JavaScript
Code
• The JavaScript code can be placed in:
• <script> tag in the head
• <script> tag in the body – not recommended
• External files, linked via <script> tag the head
22
• Files usually have .js extension
• Highly recommended
• The .js files get cached by the browser
23
• Function calls or code can be attached as "event handlers" via
tag attributes
• Executed when the event is fired by the browser
24
{
alert(message);
}
</script>
</head>
<body>
<<img src="vpcoe_Black_Transparent
LOGO.png"onclick="test('clicked!')" />
</body>
</html>
Using External Script
• Using external script files:
Files
<html> external-JavaScript.htm
<head>
l
<script src="sample.js" type="text/javascript">
</script>
The <script> tag is always
25
</head>
<body> empty.
<button onclick="sample()" value="Call JavaScript
function from sample.js" />
</body>
</html>
• External JavaScript file:
function sample() {
alert('Hello from sample.js!')
}
sample.js
Data
•Types
JavaScript data types:
• Numbers (integer, floating-point)
• Boolean (true / false)
• String type – string of characters
26
var myName = "You can use both single or double
quotes for strings";
• Arrays
var my_array = [1, 5.3, "aaa"];
27
var test = "some string";
alert(test[7]); // shows letter 'r'
alert(test.charAt(5)); // shows letter 's'
alert("test".charAt(1)); //shows letter 'e'
alert("test".substring(1,3)); //shows 'es'
28
alert(string1 + string2); // fat cats
• What is "9" + 9?
alert("9" + 9); // 99
• Converting string to
number:
alert(parseInt("9") + 9); // 18
Arrays Operations and
Properties
• Declaring new empty
array:
var arr = new Array();
• Declaring an array holding few
var arr = [1, 2, 3, 4, 5];
elements:
29
• Appending an element / getting the last
element:
arr.push(3);
var element = arr.pop();
• Reading the number of elements (array
length):
arr.length;
• Finding element's index in the
array:
arr.indexOf(1);
Standard Popup
•Boxes
Alert box with text and [OK] button
• Just a message shown in a dialog box:
alert("Some text here");
30
• Confirmation box
• Contains text, [OK] button and [Cancel]
button:
confirm("Are you sure?");
• Prompt box
• Contains text, input field with default value:
<head>
<title>JavaScript Demo</title>
32
<script type="text/javascript">
function calcSum() {
value1 =
parseInt(document.mainForm.textBox1.value);
value2 =
parseInt(document.mainForm.textBox2.value);
sum = value1 + value2;
document.mainForm.textBoxSum.value = sum;
}
</script>
</head>
Sum of Numbers – Example
sum-of-numbers.html (cont.)
(2)
<body>
<form name="mainForm">
<input type="text" name="textBox1" /> <br/>
<input type="text" name="textBox2" /> <br/>
33
<input type="button" value="Process"
onclick="javascript: calcSum()" />
<input type="text" name="textBoxSum"
readonly="readonly"/>
</form>
</body>
</html>
JavaScript Prompt –
prompt.htm
Example
lprice = prompt("Enter the price", "10.00");
alert('Price + VAT = ' + price * 1.2);
34
JavaScript -
Operators
• Arithmetic Operators
• Comparison Operators
• Logical (or Relational) Operators
• Assignment Operators
• Conditional (or ternary)
Operators
Conditional Statement
(if)
unitPrice = 1.30;
if (quantity > 100) {
unitPrice = 1.20;
}
36
Symbol Meaning
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
== Equal
!= Not equal
Switch
Statement
• The switch statement works like in
C#:
switch (variable) { switch-statements.htm
case 1:
l
// do something
37
break;
case 'a':
// do something else
break;
case 3.14:
// another code
break;
default:
// something completely different
}
Switch case
Example
Loop
s• Like in C#
• for loop
• while loop
39
• do … while
loop
var counter;
for (counter=0; counter<4; counter++)
{
alert(counter);
}
while (counter < 5)
{
alert(++counter);
loops.html
}
While-loop
Example
• <html>
• <body>
• <script type="text/javascript">
• <!-- var count = 0;
• document.write("Starting Loop ");
• while (count < 10){
• document.write("Current Count : " + count + "<br
/>"); count++; }
• document.write("Loop stopped!");
• //--> </script>
• <p>Set the variable to different value and then
try...</p>
</body> </html>
Function
s• Code structure – splitting code into parts
• Data comes in, processed, result
returned
Parameters come
41
function average(a, b, c) in here.
{
var total; Declaring variables
total = a+b+c; is optional. Type is
return total/3; never declared.
}
Value returned
here.
Function Arguments & Return
Value
• Functions are not required to return a value
• When calling function it is not obligatory to specify all of its
arguments
• The function has access to all the arguments
42
passed via arguments array
function sum() {
var sum = 0;
for (var i = 0; i < arguments.length; i ++)
sum += parseInt(arguments[i]);
return sum;
}
alert(sum(1, 2, 4));
functions-demo.html
JavaScript Function
Syntax
• function name(parameter1, parameter2, parameter3) {
code to be executed
}
function myFunction(a, b) {
return a * b; // Function returns the product of
and b a
}
Advanced JavaScript: JSON -
Introduction
• JSON stands for JavaScript Object Notation
• JSON is a text format for storing and transporting data
• JSON is "self-describing" and easy to understand
• JSON is a lightweight data-interchange format
• JSON is plain text written in JavaScript object notation
• JSON is used to send data between computers
• JSON is language independent
Why Use JSON?
• The JSON format is syntactically similar to the code for
creating JavaScript objects. Because of this, a JavaScript
program can easily convert JSON data into JavaScript
objects.
• Since the format is text only, JSON data can easily be sent
between computers, and used by any programming
language.
• JavaScript has a built in function for converting JSON
strings into JavaScript objects:
• JSON.parse()
• JavaScript also has a built in function for converting an
object into a JSON string:
• JSON.stringify()
JSON Syntax
• The JSON syntax is a subset of the JavaScript syntax.
• JSON syntax is derived from JavaScript object notation
syntax:
1. Data is in name/value pairs
2. Data is separated by commas
3. Curly braces hold objects
4. Square brackets hold arrays
Example
"name":“Sachin"
JSON Create
Data Types used in JSON
1. Number: {e.g. “age”:32}
2. String : e.g ."name":“Sachin"
3. Boolean : e.g. {“sales”:true}
4. Array : e.g. “employees”: [“Sachin”, ”Rahul”, “satish”]
5. Value: It can be string, a number, true or false, null.
6. Object: Unorder collection of key:value pairs.
e.g. {“employees”: { “name”:“Sachin”, ”age”:32, “city”:”pune”]
7. Null: empty values on JSON can be null
e.g. {“middlename”:null}
JSON Vs XML
JSON Example
{"employees":[
{"name":"Shyam", "email":"[email protected]"},
{"name":"Bob", "email":"[email protected]"},
{"name":"Jai", "email":"[email protected]"}
]}
The XML representation of above JSON example is
<employees> <employee>
<name>Shyam</name>
<email>[email protected]</email>
</employee> <employee>
<name>Bob</name>
<email>[email protected]</email>
</employee> <employee>
<name>Jai</name>
<email>[email protected]</email>
</employee> </employees>
JSON Vs XML
Uses of JSON
• Writing a script JavaScript base application that includes
browser extensions and websites.
• For serializing and transmitting structured data over
network connection.
• To transmit data between server and web application
• Web services and API’s use JSON format to provide public
data.
• In modern programming language.
Technologies used in Traditional Web
Programming: (SPPU EXAM 18, 19, 6/8 Marks)
1. Programming Languages: ways to communicate to
computers and tell them what to do.
1. Javascript - used by all web browsers, Meteor, and lots of other
frameworks.
2. Coffeescript - is a kind of “dialect” of javascript. It is viewed as simpler
and easier on your eyes as a developer but it complies (converts) back
into javascript
3. Python -used by the Django framework and used in a lot of
mathematical calculations
4. Ruby - used by the Ruby on Rails framework
5. PHP - used by Wordpress
6. Go - newer language, built for speed.
7. Objective-C - the programming language behind iOS (your iPhone), lead
by Apple
8. Swift - Apple’s newest programming language
9. Java - Used by Android (Google) and a lot of desktop applications.
Technologies used in Traditional Web
Programming:
2. Framework: Frameworks are built to make building and
working with programming languages easier.
1. Node.js - a server-side javascript framework
2. Ruby on Rails - a full-stack framework built using ruby
3. Django - a full-stack framework built using python
4. Phonegap / Cordova - a mobile framework that exposes native api’s of iOS
and Android for use when writing javascript
5. Bootstrap - a UI (user interface) framework for building with
HTML/CSS/Javascript
6. Foundation - a UI framework for building with HTML/CSS/Javascript
7. Wordpress - a CMS (content management system) built on PHP.
Currently, about 20% of all websites run on this framework
8. Drupal - a CMS framework built using PHP.
9. .NET - a full-stack framework built by Microsoft
10. Angular.js - a front-end javascript framework.
11. Ember.js - a front-end javascript framework.
12. Backbone.js - a front-end javascript framework.
Technologies used in Traditional Web
Programming:
3. Libraries : Libraries are groupings of code snippets to enable a large
amount of functionality without having to write it all by yourself.
E.g. jQuery
• Example:
{
"first_name" : "Sammy",
"last_name" : "Shark",
"online" : true
}
JSON Access:
• JSON data is normally accessed in Javascript through dot
notation. let’s consider the JSON object sammy:
var sammy = {
"first_name" : "Sammy",
"last_name" : "Shark",
"online" : true
}
• In order to access any of the values, we’ll be using dot
notation that looks like this:
sammy.first_name
sammy.last_name
sammy.online
• Output
Sammy
JSON Array
• Inside the JSON string there is a JSON array literal:
<script>
const myJSON = '["Ford", "BMW", "Fiat"]';
const myArray = JSON.parse(myJSON);
document.getElementById("demo").innerHTML = myArray;
</script>
</body>
</html>
JSON Array
Accessing Array Values:
<script>
const myJSON = '["Ford", "BMW", "Fiat"]';
const myArray = JSON.parse(myJSON);
document.getElementById("demo").innerHTML = myArray[0];
</script>
</body>
</html>
JSON Array
Arrays in Objects
Objects can contain arrays:
Example
{
"name":"John",
"age":30,
"cars":["Ford", "BMW", "Fiat"]
}
myObj.cars[0];
JS Arrow Functions
• Syntax
let myFunction = (arg1, arg2, ...argN) => { statement(s) }
Here,
myFunction is the name of the function
arg1, arg2, ...argN are the function arguments
statement(s) is the function body
If the body has single statement or expression, you can write arrow function as:
let myFunction = (arg1, arg2, ...argN) => expression
• Arrow function is one of the features introduced in the ES6 version of JavaScript. It
allows you to create functions in a cleaner way compared to regular functions.
• Example,
// function expression
let x = function(x, y) {
return x * y;
}
can be written as using an arrow function
// using arrow functions
let x = (x, y) => x * y;
JS Callback Functions
• A callback is a function passed as an argument to another function.
• This technique allows a function to call another function
• A callback function can run after another function has finished
• JavaScript functions are executed in the sequence they are called.
Example:
function myDisplayer(some) {
document.getElementById("demo").innerHTML = some;
}
myCalculator(5, 5, myDisplayer);
Output: 10
JS Promises
• A Promise is a JavaScript object that links producing code and consuming code
• "Producing code" is code that can take some time
• "Consuming code" is code that must wait for the result.
• ECMAScript 2015, also known as ES6, introduced the JavaScript Promise object.
• The first browser version with full support for Promise objects:
Chrome 33 Edge 12 Firefox 29 Safari 7.1 Opera 20
Feb, 2014 Jul, 2015 Apr, 2014 Sep, 2014 Mar, 2014
Promise Syntax:
Result Call
Success myResolve(result value)
Error myReject(error object)
• Pending
• Fulfilled
• Rejected
myPromise.state myPromise.result
"pending" undefined
"fulfilled" a result value
"rejected" an error object
JS Promises
• how to use a Promise:
myPromise.then(
function(value) { /* code if successful */ },
function(error) { /* code if some error */ }
);
Example: <script>
function myDisplayer(some) {
document.getElementById("demo").innerHTML = some;
}
let myPromise = new Promise(function(myResolve, myReject) {
let x = 0;
// some code (try to change x to 5)
if (x == 0) {
myResolve("OK");
} else {
Output:
myReject("Error");
} OK
});
myPromise.then(
function(value) {myDisplayer(value);},
function(error) {myDisplayer(error);}
);
</script>
JS Async-Await Functions
• async makes a function return a Promise
• await makes a function wait for a Promise
Async Syntax:
async function myFunction() {
return "Hello";
}
Is the same as:
function myFunction() {
return Promise.resolve("Hello");
}
Here is how to use the Promise:
myFunction().then(
function(value) { /* code if successful */ },
function(error) { /* code if some error */ }
);
JS Async-Await Functions
Example:
<script>
function myDisplayer(some) {
document.getElementById("demo").innerHTML = some;
}
myFunction().then(
function(value) {myDisplayer(value);},
function(error) {myDisplayer(error);}
);
</script>
Output:
Hello
JS Async-Await Functions
Await Syntax:
• Syntax:
try
{
// code that may throw an error
}
catch(ex)
{
// code to be executed if an error occurs
}
finally{
// code to be executed regardless of an error occurs or not
}
JS Error Handling
• Example:
Output:
<!DOCTYPE html>
Error: ReferenceError: Sum is not defined
<html>
<body>
finally block executed
<p id="errorMessage">Error: </p>
<p id="message"></p>
<script>
try
{
var result = Sum(10, 20); // Sum is not defined yet
}
catch(ex)
{
document.getElementById("errorMessage").innerHTML += ex;
}
finally{
document.getElementById("message").innerHTML = "finally block executed";
}
</script>
</body>
JS Error Handling
• throw: Use throw keyword to raise a custom error.
• Example:
<!DOCTYPE html> Output:
<html> Error occurred
<body>
<p id="errorMessage"></p>
<script>
try
{
throw "Error occurred";
}
catch(ex)
{
document.getElementById("errorMessage").innerHTML = ex;
}
</script>
</body>
</html>
AJAX- Introduction
• AJAX = Asynchronous JavaScript And XML(Extensible Markup Language).
xhttp.open("GET", "ajax_info.txt");
xhttp.send();
Example
// Create an XMLHttpRequest object
const xhttp = new XMLHttpRequest();
// Send a request
xhttp.open("GET", "ajax_info.txt");
xhttp.send();
Call HTTP Methods Using AJAX
XMLHttpRequest Object Methods:
Method Description
new XMLHttpRequest() Creates a new XMLHttpRequest object
abort() Cancels the current request
getAllResponseHeaders() Returns header information
getResponseHeader() Returns specific header information
open(method, url, async, Specifies the request
user, psw) method: the request type GET or POST
url: the file location
async: true (asynchronous) or false
(synchronous)
user: optional user name
psw: optional password
send() Sends the request to the server
Used for GET requests
send(string) Sends the request to the server.
Used for POST requests
Call HTTP Methods Using AJAX
XMLHttpRequest Object Properties
Property Description
onload Defines a function to be called when the request is recieved
(loaded)
onreadystatechange Defines a function to be called when the readyState property
changes
readyState Holds the status of the XMLHttpRequest.
0: request not initialized
1: server connection established
2: request received
3: processing request
4: request finished and response is ready
responseText Returns the response data as a string
submit or retrieve data from the server without reloading the whole
page.
• $.ajax() can be used to send http GET, POST, PUT, DELETE etc.
• Syntax: $.ajax(url,[options])
• a function that will be triggered by the client event and a callback function
processRequest() will be registered.
function validateUserId() {
ajaxFunction();
function validateUserId() {
ajaxFunction();
Assume you enter Zara in the userid box, then in the above request, the URL is
set to "validate?id = Zara".
Data Sending and Receiving data in AJAX
4. Webserver Returns the Result Containing XML Document
function processRequest() {
if (req.readyState == 4) {
if (req.status == 200) {
var message = ...;
...
}
Data Sending and Receiving data in AJAX
}
).error(function (jqXHR, textStatus, errorThrown) {
alert(formatErrorMessage(jqXHR, errorThrown));
}
);
AJAX Error Handling
1) jqXHR : This variable will contain status code and we can access by
“jqXHR.status”.
2) textStatus : Response in text like Success.
3) errorThrown : Some time error may be related to parse error, timeout error so
these error message will come under this variable.
alert(formatErrorMessage(jqXHR, errorThrown));
1) alert : Simple. using to show error message
2) formatErrorMessage : We are using this function to parse this variable and get
exact error and to show a proper message to user.
jQuery -
Introduction
• jQuery is a JavaScript Library.
• jQuery greatly simplifies JavaScript programming.
• jQuery is a lightweight
• jQuery also simplifies a lot of the complicated things
from JavaScript, like AJAX calls and DOM manipulation.
• The jQuery library contains the following features:
• HTML/DOM manipulation
• CSS manipulation
• HTML event methods
• Effects and animations
• AJAX
• Utilities
Adding jQuery to Your
Web Pages
• There are several ways to start using jQuery on your
web
site. You can:
• Download the jQuery library from jQuery.com
• Include jQuery from a CDN, like Google
Downloading
jQuery
• There are two versions of jQuery available for downloading:
• Production version - this is for your live website because it
has been minified and compressed
• Development version - this is for testing and development
• Both versions can be downloaded from jQuery.com.
• The jQuery library is a single JavaScript file, and you
reference it with the HTML <script> tag (notice that the
<script> tag should be inside the <head> section):
<head>
<script src="jquery-3.2.1.min.js"></script>
</head>
• Tip: Place the downloaded file in the same directory as
the pages where you wish to use it.
jQuery
CDN
• If you don't want to download and host jQuery yourself, you
can include it from a CDN (Content Delivery Network).
• Both Google and Microsoft host jQuery.
• To use jQuery from Google or Microsoft, use one of the
following:
• Google CDN:
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"
>
</script>
</head>
jQuery
Syntax
• With jQuery you select (query) HTML elements and
perform "actions" on them.
• syntax :
• $(selector).action()
• A $ sign to define/access jQuery
• A (selector) to "query (or find)" HTML elements
• A jQuery action() to be performed on the element(s)
• Examples:
• $(this).hide() - hides the current element.
• $("p").hide() - hides all <p> elements.
• $(".test").hide() - hides all elements with class="test".
• $("#test").hide() - hides the element with id="test".
jQuery
Selectors-Selecting
elements
• jQuery selectors allow you to select and manipulate
HTML element(s).
• jQuery selectors are used to "find" (or select) HTML
elements based on their name, id, classes, types, attributes,
values of attributes and much more. It's based on the
existing CSS Selectors, and in addition, it has some own
custom selectors.
• All selectors in jQuery start with the dollar sign
and parentheses: $().
The element
Selector
• The jQuery element selector selects elements based on the
element name.
• You can select all <p> elements on a page like this:
• $("p")
• Example
• When a user clicks on a button, all <p> elements will be
hidden:
• $(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
The #id
Selector
• The jQuery #id selector uses the id attribute of an HTML tag to find
the specific element.
• An id should be unique within a page, so you should use the #id
selector when you want to find a single, unique element.
• To find an element with a specific id, write a hash
character, followed by the id of the HTML element:
• $("#test")
• Example
• When a user clicks on a button, the element with id="test" will be
hidden:
• $(document).ready(function(){
$("button").click(function(){
$("#test").hide();
});
});
jQuery css() Method- Changing
Style
• jQuery css() Method
• The css() method sets or returns one or more style
properties for the selected elements.
• Return a CSS Property
• To return the value of a specified CSS property, use
the following syntax:
• css("propertyname");
• Set a CSS Property
• To set a specified CSS property, use the following
syntax:
• css("propertyname","value");
Changing Style-
Return a CSS Property
Example
<html><head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></s
c ript>
<script>
$(document).ready(function(){
$("button").click(function(){
alert("Background color = " + $("p").css("background-color"));
});
});
</script>
</head><body>
<p style="background-color:#ff0000">This is a paragraph.</p>
<button>Return background-color of p</button>
</body></html>
Changing Style-
Return a CSS Property Example
o/p
Output of Previous Code
Changing Style-
Set a CSS Property
Example
<html><head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script
>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").css("background-color", "yellow");
});
});
</script>
</head>
<body>
<p style="background-color:#ff0000">This is a paragraph.</p>
<button>Set background-color of p</button>
</body></html>
Changing Style-
Set a CSS Property Example
o/p
Output of Previous Code
Synatx : $(selector).html();
$(selector).text();
The jQuery text() method returns plain text value of the content where
as html() returns the content with HTML tags.
Example:
Dynamic Content Change with JQuery
How to handle events in dynamically created elements in jQuery ?
<!DOCTYPE html>
<html>
<head>
<title>
How to handle events in dynamically created elements in jQuery?
</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
<script>
$(document).ready(function () {
$("#list li").on("click", function (event) { $('#list').append('<li>New Paragraph</li>');
}); });
</script> <style>
li {
font-size: 30px;
width: 400px;
padding: 20px;
color: green;
}
</style> </head> <body>
<!-- Click on this paragraph -->
<ul id="list">
<li>Click here to append !!!</li>
</ul>
</body>
</html >
Dynamic Content Change with JQuery
How to handle events in dynamically created elements in jQuery ?
On first, second ….. Mouse click, following output will display in web browser:
UI Design Using JQuery
• jQuery UI is a curated(online content) set of user interface interactions,
effects, widgets, and themes built on top of the jQuery JavaScript Library.
• For building highly interactive web applications.
• four groups i.e. interactions, widgets, effects, utilities.
• open-source library that contains different animation effects and widgets
• It can be used with almost all browsers.
• Download & Installation: (https://jqueryui.com/),
• File Structure:
• Using CDN Link: Without downloading the jQuery UI files, you can include
CDN links inside the head section to run your code.
<link href=”https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css”
rel =”stylesheet”>
<script src=”https://code.jquery.com/jquery-1.10.2.js”></script>
<script src=”https://code.jquery.com/ui/1.10.4/jquery-ui.js”></script>.