×
Clear all filters including search bar
Valeri Tandilashvili's Personal Professional Blog
<link rel="stylesheet" href="responsive.css" media="screen and (max-width: 900px)">
2. @media query without <link>
@media screen and (max-width: 900px) {
/* conditional CSS */
}
<input type="checkbox" id="vehicle1" name="vehicle[]" value="Bike">
<label for="vehicle1"> I have a bike</label><br>
<input type="checkbox" id="vehicle2" name="vehicle[]" value="Car">
<label for="vehicle2"> I have a car</label><br>
We can have checkboxes with the same name by putting square brackets at the end of the name
value. On server side we receive them whichever is checked as an arraythe root
An XML tree
starts at a root element
and branches from the root to child elements
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
The terms parent
, child
, and sibling
are used to describe the relationships between elements.
...
Parents
have children.
Children
have parents.
Siblings
are children on the same level (brothers and sisters).
...
We can use any of the online XML tree viewer tools to see the document's tree structure, like this one:https://www.xmlviewer.org/
Books
XML document to see on tree-viewer<books>
<book category="cooking">
<title lang="en">The goals</title>
<author>Giada De Laurentiis</author>
<year>2007</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">12 rules for life</title>
<author>J K. Rowling</author>
<year>2002</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">The richest man in Babilon</title>
<author>Erik T. Ray</author>
<year>2001</year>
<price>39.95</price>
</book>
</books>
{ "name": "John" }
In JavaScript we can have names without quotes:{ name: "John" }
In JavaScript, keys can be strings, numbers, or identifier names:{ 12: "John" }
In JSON
, values must be one of the following data types:- a string
- a number
- an object (JSON object)
- an array
- a boolean
- null
In JavaScript
, values can be all of the above listed types, plus any other valid JavaScript expression, including:- a function
- a date
- a symbol
- undefined
In JSON
, string values must be written with double quotes:{ "name":"John" }
In JavaScript
, we can write string values with double or single quotes:{ name: 'John' }
JSON.parse(str)
will not convert date string to date object and we get an errorlet str = '{"title":"Conference","date":"2017-11-30T12:00:00.000Z"}';
let meetup = JSON.parse(str);
document.write( meetup.date.getDate() ); // Error!
The value of meetup.date
is a string, not a Date
object.
That is why JSON.parse
was unable to transform that string into a Date
object.
...
Passing the reviving function to JSON.parse
as the second argument fixes the issue.
The reviving function returns all values “as is”, but date
will become a Date
object and the error will not occur
let str = '{"title":"Conference","date":"2017-11-30T12:00:00.000Z"}';
let meetup = JSON.parse(str, function(key, value) {
if (key == 'date') return new Date(value);
return value;
});
alert( meetup.date.getDate() ); // now works!
Metadata
:
Content that sets up the presentation or behavior of the rest of the content. These elements are found in the head of the document.
Elements:
<base>
, <link>
, <meta>
, <noscript>
, <script>
, <style>
, <title>
Embedded
:
Content that imports other resources into the document.
Elements:
<audio>
, <video>
, <canvas>
, <iframe>
, <img>
, <math>
, <object>
, <svg>
Interactive
Content specifically intended for user interaction.
Elements:
<a>
, <audio>
, <video>
, <button>
, <details>
, <embed>
, <iframe>
, <img>
, <input>
, <label>
, <object>
, <select>
, <textarea>
Heading
Defines a section header.
Elements:
<h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, <hgroup>
Phrasing
This model has a number of inline level elements in common with HTML4.
Elements:
<img>
, <span>
, <strong>
, <label>
, <br />
, <small>
, <sub>
, ...Route::resource('posts', 'PostsController');
These routes are:
GET
at posts
to list all the posts
POST
at posts
to store new post
GET
at posts/create
to show form for creating new post
GET
at posts/{post}
to show the post
PUT
at posts/{post}
to update the post
DELETE
at posts/{post}
to delete the post
GET
at posts/{post}/edit
to show edit form.container {
background: url(../images/tile.png) left bottom repeat-x, #FFF url(../images/tile.png) left top repeat-x;
}
XML Attribute
specifies a single property for the element, using a name/value
pair. An XML-element can have one or more
attributes<a href = "http://www.applications.ge/">Applications.ge</a>
In the example href
is the attribute name
and http://www.applications.ge
is the attribute value
...
XML attribute names (unlike HTML) are case sensitive. Which means that HREF
and href
are considered two different XML attributes<?xml version="1.0"?>
<student>
<a href="http://www.applications.ge/" hreF="HTTP://applications.ge/">Applications.ge</a>
</student>
Several different values for the same attribute is not allowed. An attribute name must not appear more than once in the same tags:<?xml version="1.0"?>
<student>
<a href="http://www.applications.ge/" href="HTTP://applications.ge/">Applications.ge</a>
</student>
The following error will appear on the browsererror on line 3 at column 73: Attribute href
redefined
Attribute names must always be defined without quotation marks, whereas attribute values must always appear in single or double quotation marks<?xml version="1.0"?>
<student>
<a "href"="http://www.applications.ge/">Applications.ge</a>
</student>
The following error will appear:error on line 3 at column 8: error parsing attribute name
Attribute values must always be in quotation marks (single '
or double "
quotes)<?xml version="1.0"?>
<student>
<a href=http://www.applications.ge/>Applications.ge</a>
</student>
This incorrect syntax will generate the following error:error on line 3 at column 13: AttValue: " or ' expected
GET
- Retrieves data from the server
HEAD
- Retrieves only headers (without the response body)
POST
- Submits data to the server (used to create resources)
PUT
- Updates/Replaces data on the server
PATCH
- Update/Modify data on the server (used to apply partial modifications to a resource)
DELETE
- Deletes data from the server