JavaScript

AJAX with native JavaScript

AJAX with native JavaScript

09.05.19
Consider a few examples of working with AJAX with native JavaScript. Functions are written with ECMAScript-2015 syntax The function for the GET method: let ajaxGet = (url, callback) => { let xhr = new XMLHt...
Submitting Form Data with AJAX and jQuery

Submitting Form Data with AJAX and jQuery

02.05.19
We will send form data without reloading the page using jQuery. We will not consider processing the server part. Sample form: <form id="test_ajax_form" method="post" action="test_handler_form.php"> <inp...
Array max js

Array max js

01.05.19
A short note about finding the maximum value in a JavaScript array with numeric values. The Array object in JS does not have its own max method. But we can add it. Array.prototype.max = function () { return Math...
Cloning objects and arrays in JavaScript

Cloning objects and arrays in JavaScript

30.04.19
For cloning objects in JS there is no specially provided method. You can copy an object in different ways. Since objects are passed by reference, we cannot clone simply by assigning a value to a variable. Objects Wit...
Enumerating array elements without cycles

Enumerating array elements without cycles

29.04.19
The examples are very abstract, since the cycles exist. You must select all the elements of the array for a given attribute. There are several solutions. The most appropriate option in PHP is to use the built-in funct...
<<  1 2 3 [45  >>