Client-/Server-side AND the DOM Flashcards
Define a web application
A web application is a dynamic web site with a functionality similar to desktop software
Frontend VS Backend
Frontend -> Client side
Backend -> Server side
Client VS Server Side Web Applications
client-side -> uses client side languages, code is executed on client side
server-side -> server side languages, code executed on server side.
Server Side Execution
- Code is private (on the server)
- Can enforce specific versions of the scripting language
- Can use non standard language elements
- Can access server-side resources
Client Side Execution
- Code is public, code is sent with a GET request
- Can be changed by the user
- Has to be compatible with different browsers
- Lowers the execution load on the server
- More network traffic
The Document Object Model (DOM) -what is it?
The DOM is an Object tree of HTML tags + an API to manipulate it
–The way for scripting languages to access the web site.
JS modifying the DOM
document. getElementById(“header1”).textContent = “New”;
document. getElementById(“myPic”).src = “cat.jpg”;
document. getElementById(“header1”).style.color = “blue”;
element. removeChild(element.firstChild);
When should DOM modification happen?
HTML events e.g.
GO!