web programming

PDF 36 стр. 527,4 КБ Бесплатная загрузка

Предварительный просмотр (5 стр.)

Прокрутите вниз 👇
1 / 36
powerpoint presentation web programming instructor: melaku m. target group: g4 cs student chapter 4 ❖javascript often abbreviated as js, is a programming language and core technology of the web, alongside html and css. 99% of websites use javascript on the client side for webpage behavior. ❖javascript is a programming language, mostly used to define the interactive behavior of web pages. ❖web browsers have a dedicated javascript engine that executes the client code. ❖javascript is a weakly typed language (dynamically typed). javascript can be used for client-side developments as well as server-side developments. javascript https://en.wikipedia.org/wiki/programming_language https://en.wikipedia.org/wiki/world_wide_web https://en.wikipedia.org/wiki/html https://en.wikipedia.org/wiki/css https://en.wikipedia.org/wiki/website https://en.wikipedia.org/wiki/client_(computing) https://en.wikipedia.org/wiki/web_page https://en.wikipedia.org/wiki/javascript https://en.wikipedia.org/wiki/web_browser https://en.wikipedia.org/wiki/javascript_engine https://en.wikipedia.org/wiki/source_code ❖there are three primary ways to incorporate javascript into your html document: 1) external javascript file: this is the most common method for larger projects, as it promotes better organization and code reusability. ❖steps: 1. create a separate .js file: write your javascript code in a …
2 / 36
."); less common, you can also include javascript code within an html attribute, typically the on* attributes (e.g., onclick, onload). example: click me 3. inline javascriptwhile in javascript, input and output operations are essential for creating interactive web applications. they allow users to interact with the program, providing input and receiving output. basic javascript input output ❖javascript can "display" data in different ways: i. writing into an html element, using innerhtml. ii. writing into the html output using document.write(). iii. writing into an alert box, using window.alert(). iv. writing into the browser console, using console.log(). basic javascript output ❖to access an html element, javascript can use the document.getelementbyid(id) method. ❖the id attribute defines the html element. the innerhtml property defines the html content: using innerhtml my first web page my first paragraph document.getelementbyid("demo") .innerhtml = 5 + 6; ❖for testing purposes only, it is convenient to use document.write(): using document.write() …
3 / 36
("are you sure?"); console.log(isconfirmed); basic javascript input ❖javascript is a dynamically typed language, meaning you don't need to declare the data type of a variable before assigning a value to it. the interpreter automatically determines the data type based on the value assigned. primitive data types 1. number: represents numeric values, both integers and floating-point numbers. let age = 25; let pi = 3.14159; javascript data types 2. string: represents a sequence of characters enclosed in ‘’ or “” quotes. let name = "alice"; 3. boolean: represents a logical value, either true or false. let isloggedin = true; 4. undefined: variable that has been declared but not assigned a value. let x; // x is undefined ❖null: represents an intentional absence of any object value. let y = null; javascript data types ❖variables are containers that are used to store data. you can declare them using the following keywords: ✓var: …
4 / 36
values to their indices: fruits[1] = "grape"; arrays in javascript ❖used to perform mathematical operations on numbers. arithmetic operators ❖used to combine conditional statements and return a boolean value. logical operators let x = 10; let y = 5;// arithmetic operations let sum = x + y;let difference = x - y; let product = x * y;let quotient = x / y; let remainder = x % y;// logical operations let isgreaterthanfive = x > 5; // true let islessthanten = y = 18) { console.log("you are an adult."); } else { console.log("you are a minor."); } demo program for (let i = 1; i <= 5; i++) { console.log(i); } let numbers = [1, 2, 3, 4, 5]; for (let number of numbers) { console.log(number); } ❖functions are reusable blocks of code that perform specific tasks. they help to organize code, improve readability, and avoid code duplication. javascript …
5 / 36
example.com). ❖location.port: gets the port number (e.g., 80). ❖location.pathname: gets the pathname (e.g., /path/to/file.html). ❖location.search: gets the query string (e.g., ?param1=value1&param2=value2). ❖location.hash: gets the anchor part of the url (e.g., #section1). ❖location.reload(): reloads the current page. ❖location.assign(url): loads a new url. ❖location.replace(url): replaces the current url with a new one. key objects in the bom: location object

Хотите читать дальше?

Скачайте все 36 страниц бесплатно через Telegram.

Скачать полный файл

О "web programming"

powerpoint presentation web programming instructor: melaku m. target group: g4 cs student chapter 4 ❖javascript often abbreviated as js, is a programming language and core technology of the web, alongside html and css. 99% of websites use javascript on the client side for webpage behavior. ❖javascript is a programming language, mostly used to define the interactive behavior of web pages. ❖web browsers have a dedicated javascript engine that executes the client code. ❖javascript is a weakly typed language (dynamically typed). javascript can be used for client-side developments as well as server-side developments. javascript https://en.wikipedia.org/wiki/programming_language https://en.wikipedia.org/wiki/world_wide_web https://en.wikipedia.org/wiki/html https://en.wikipedia.org/wiki/css http...

Этот файл содержит 36 стр. в формате PDF (527,4 КБ). Чтобы скачать "web programming", нажмите кнопку Telegram слева.

Теги: web programming PDF 36 стр. Бесплатная загрузка Telegram