Simple Javascript Application – Lebedev 421 – Saint-Petersburg State University



Simple Javascript Application – Lebedev 421 – Saint-Petersburg State University

0 0


p


On Github nadalfederer / p

Simple Javascript Application

Lebedev 421

Saint-Petersburg State University

2015

Introduciton

  • Node js
  • js,html,css

Javascript

Alongside with HTML and CSS, it is one of the three essential technologies of World Wide Web content production; the majority of websites employ it and it is supported by all modern web browsers without plugins

Node js

A JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient

How the request works?

https://strongmysterious-atoll-5788.herokuapp.com/templates/profile_main.html

            this.templatePath = '/templates/search.html';
                var xhr = new XMLHttpRequest();
                xhr.open('GET', pathToTemplate, true);

public/templates/profile_main.html

JSON

an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is the primary data format used for asynchronous browser/server communication.

Html5 features - sessionstorage

With local storage, web applications can store data locally within the user's browser. Before HTML5, application data had to be stored in cookies, included in every server request. Local storage is more secure, and large amounts of data can be stored locally, without affecting website performance.

                var template = sessionStorage.getItem(pathToTemplate);
                    sessionStorage.setItem(pathToTemplate,template);
                
            

Searching users

var xhr = new XMLHttpRequest();
                xhr.open('GET', 'https://api.github.com/search/users?q=' + query
                + '', true);
            

THE END

Simple Javascript Application Lebedev 421 Saint-Petersburg State University 2015