• Nie Znaleziono Wyników

From HTML to PostGIS

N/A
N/A
Protected

Academic year: 2021

Share "From HTML to PostGIS"

Copied!
17
0
0

Pełen tekst

(1)

From HTML to PostGIS

Michał Okulewicz

Wydział Matematyki i Nauk Informacyjnych Politechnika Warszawska

(2)

Lecture plan

1 JavaScript Introduction DOM and Events

(3)

JavaScript

Purpose and syntax of JavaScript

JavaScript based web applications (DOM and Events)

Creating and changing the contents of the website

Event handler properties (element.onsth = handler ;)

Document Object Model Level 2 Events (add/removeEventListener)

Creating and changing the styles on the website

style property

using classes

Selected additional topics

Utilizing canvas

(4)

Introduction

JavaScript is a programming language primarily used to enrich the functionality of web sites by adding dynamic interaction with the user

JavaScript in an interpreted language with interpreter built in the most of the browsers

JavaScript is the reason why we even do have the Single Page Applications

JavaScript processing engines are available also outside the browser (see: node.js)

Side note: The original JavaScript was actually one of the early dialects of an ECMAScript standard

(5)

Versions of ECMAScript and their support

Version Support

ES5 (2009) All major browsers ES6 / ES2015 Edge 17 / FF 60 /CH 68

ES2016 CH 68

ES2017 CH 68

ES2018 CH 68

source

(6)

Further reading

ES5 specification andW3Schools walk-through

ES6 specification andW3Schools walk-through

Differences between ES5 and ES6(note to self: click it!)

Document Object Model specification

DOM Level 2 Events specification

(7)

The simplest example

(8)

Analyze types and syntax details

Run ip 4 js fin playground.html...

Check the following:

Numbers and strings

Booleans (see:John 18,38)

Loops and exceptions (play with debugger)

Objects definitions

(9)

Analyze types and syntax details

Run ip 4 js fin playground.html...

Check the following:

Numbers and strings

Booleans (see:John 18,38)

Loops and exceptions (play with debugger)

Objects definitions

(10)

Analyze types and syntax details

Run ip 4 js fin playground.html...

Check the following:

Numbers and strings

Booleans (see:John 18,38)

Loops and exceptions (play with debugger)

Objects definitions

(11)

Analyze types and syntax details

Run ip 4 js fin playground.html...

Check the following:

Numbers and strings

Booleans (see:John 18,38)

Loops and exceptions (play with debugger)

Objects definitions

(12)

Analyze types and syntax details

Run ip 4 js fin playground.html...

Check the following:

Numbers and strings

Booleans (see:John 18,38)

Loops and exceptions (play with debugger)

Objects definitions

(13)

Not so stupid example

(14)

Not so stupid example explained

This one operates on a tree-like structure of an HTML document

It waits till the document is ready

It creates a paragraph and text node in memory

It constructs a paragraph with contents

It adds paragraph to the body of the document

(15)

Typical JS use cases

Content manipulation

Data validation

(16)

Table generation

Run ip 4 js partII playground.html...

(note to self: remember to talk about closure)

(17)

Form validation

Run ip 4 js partII playground.html...

This time consider using classes instead of inline style changes (note to self: remember JS hooks).

Cytaty

Powiązane dokumenty

• jQuery speeds up writing the code and provides universal API for all browsers. • plain JavaScript code will always be faster (if

• The current idea are Single Page Applications consisting of HTML/CSS layout utilized by JavaScript application with content provided from REST services in a form of JSON

• With AJAX, we are taking a bunch of dusty old technologies and stretching them well beyond their original scope – AJAX in Action, Manning, 2006. Michał

Monte Carlo (MC) and inverse Monte Carlo (IMC) algorithms include a correction for losses at the sides of the sample [6]–[8]. Roggan et al. avoided the effect of loss of light

mych, nieznanych skądinąd większości czytelników, a przy tym są to dedykacje za- ledwie kilkuwyrazowe, pozbawione tytulatury i pochwalnych ozdobników, czasem nawet bez

Okazuje się bowiem, że różnice w praktykach publikacyjnych w różnych dyscyplinach naukowych są na tyle istotne, że używając do analiz zgłoszeń publikacyj- nych, otrzymujemy

Błonie, parafia Krośniewice (dziś województwo mazowieckie). Nietrudno domyślić się, dla- czego młody poznaniak z nowoczesnego na owe czasy miasta przeniósł się do biednego

On the other hand if M G is very low (for a value of d equal to 0), the distance from which the gravity represented by the mass M G has no longer an effect will be very low