12. Browser agent
User normal
User important
Author normal
Author important
Browser agent
User normal
Author normal
Author important
User important
13. Στρογγυλεμένα περιγράμματα
Χρησιμοποίησε την border-radius ιδιότητα για να κάνει στρογγυλεμένες γωνίες
Σύνορα με σκιά
Χρησιμοποίησε την box-shadow ιδιότητα για να προσθέσετε σκιά σε κουτιά
HTML5 stresses spearting structure, presentation, and behaviour
XML – always requires matching tags, has no specific set of tags
SGML – older markup language, HTML roots are from, which was used in doc publishing
XHTML – XML-based that tightened the HTML specification
HTML5 originates from HTML4.0. It contains most of it’s tags but many of them have been redefined to be semantic tags.
CSS3 is the latest standard for CSS
It is completely backwards-compatible with earlier versions of CSS
Now let’s take a look at new stuff introduced in CSS3
Fonts – import fonts that are not available from browser
Animations – change of color, change of position of shapes
2d/3d transforms – rotate, scale, skew, matrix
Multiple columns – column-gap, width, span
User Interface – box-sizing, box-flex
JavaScript provides the ability to implement inheritance, which is useful when you can define the relationship between two objects as an “is a” relationship. For example, an apple is a fruit, an employee is a person, and a piano is an instrument.
This class is wrapped in an IIFE. The wrapper encapsulates the function and the Vehicle prototype. There is no attempt to make the data private. The code works as follows.
When the code is loaded into the browser, the IIFE is immediately invoked.
A nested function called Vehicle is defined in the IIFE.
The Vehicle function’s prototype defines getInfo and startEngine functions that are on every instance of Vehicle.
A reference to the Vehicle function is returned, which is assigned to the Vehicle variable.
This is a great way to create a class, and all future class examples use this pattern. To create Vehicle objects, you use the new keyword with the Vehicle variable. The following test creates an instance of Vehicle and tests the getInfo and startEngine methods.
JavaScript provides the ability to implement inheritance, which is useful when you can define the relationship between two objects as an “is a” relationship. For example, an apple is a fruit, an employee is a person, and a piano is an instrument.
This class is wrapped in an IIFE. The wrapper encapsulates the function and the Vehicle prototype. There is no attempt to make the data private. The code works as follows.
When the code is loaded into the browser, the IIFE is immediately invoked.
A nested function called Vehicle is defined in the IIFE.
The Vehicle function’s prototype defines getInfo and startEngine functions that are on every instance of Vehicle.
A reference to the Vehicle function is returned, which is assigned to the Vehicle variable.
This is a great way to create a class, and all future class examples use this pattern. To create Vehicle objects, you use the new keyword with the Vehicle variable. The following test creates an instance of Vehicle and tests the getInfo and startEngine methods.
jQuery is a library of helper functions that are cross browser–compatible. You can minimize the amount of browser-specific code.
jQuery is written in JavaScript, so it is JavaScript. You can read the jQuery source code to understand how jQuery works. It’s easy to use, it’s stable, it’s fully documented, and it works well with other frameworks.
The following is a list of the categories of functionality jQuery provides
Asynchronous Javascript and XML
Using AJAX, you can write JavaScript that asynchronously calls the server and processes the result. While this is happening, the user’s screen doesn’t lock up or freeze while waiting for the call to the server to complete.
In this example, jQuery retrieves the values of x and y. A data variable object is then created to hold x and y. The $.ajax() call is executed next; it takes an object argument with all the settings for the call. In this example, the object is created inline. The url property is set, and the data is set to the data object created in the previous statement. The type property is the HTTP method, which supports GET, POST, PUT, and DELETE, but remember that many firewalls block PUT and DELETE. The cache property is set to false to indicate that the result should not be cached. The dataType property defines the type of data you expect to receive from the server and can be set to ‘json’, ‘xml’, ‘html’, ‘script’, ‘jsonp’, or ‘text’.