javascript

React. Error when importing an object (Attempted import error)

Standard scheme: there are several files with constant objects in the same folder, sent for export to index.js for further ge ... s used in other projects, but relative paths were used there. Maybe because of this, webpack can't build the files correctly?

SetTimeout. How do I do this inside the loop?

<script> var height = window.innerHeight; var width = window.innerWidth; { function change_bg() { var i = 1; // во ... w can I do this? To do this, I need all this function to be inside the loop. But what kind, I can not put. Help me understand

The function for loading (the show more button) data from an array of objects does not respond to the onclick event

When loading a page, objects taken from another page via ajax are placed in my array. For the sake of experiment, I added 200 ... me to find the example code on the Internet, so I follow my own logic. Am I thinking correctly? Why doesn't the event work?

How to make the text not stand out

I have a div, it has a onclick handler, but there is text on the div and it is sometimes highlighted. How do I make it not stand out? Preferably via css.

Copy a multidimensional array to JavaScript

You need to make a copy of the array that will not reference the old array. I tried using jQuery, but still when changing a new array, the values in the old one change. array_1 = $.extend(true, [], array_2);

jquery add get parameter

When selecting select, the script constantly adds a parameter, how can I add it once and just change it for the next changes? ... val = $("#sort_by").val(); history.pushState(null, null, window.location+'&sort='+val); });

autocomplete in JS

I need that when filling out the form, the data is searched in the database and offered for selection. I don't know JS myself ... s able to google it what I need-autocomplete, but how to attach it to this code I do not understand. Can you help me, please?

How to compare strings ignoring diacritics?

The user enters the string Arke. I need to compare it with the string Arkè, so that they are equal. The word Arkè with a diacritic mark is just an example. we need a solution that will work with such diacritics.

Jquery find the id of the parent diva

There is such a construction: <div id='1' class="parent_div"> <div class="div_child">Текст</div> </ ... to this function for another diva, then I will again get the same id, instead of the one that corresponds to the other diva.

Pop-up window (self-written or fancybox?)

It is worth fancybox now. You need a plugin for the subscription form. When you click on the link, a pop-up window with the f ... efficient to push the subscription form into display:none and display it when you click on the link using position: absolute?

OAuth2 vk.com

Good afternoon, I'm trying to get a token: Https://oauth.vk.com/authorize?client_id=**&scope=4096&redirect_uri=local ... he link in the browser, the application on the local host, and it works fine in VK. That's probably not the problem. Thanks.

The friends.areFriends method doesn't work (VK API)

<script type="text/javascript" src="http://userapi.com/js/api/openapi.js?49"></script> <script type=" ... Does not work. They say error data.response.length; and document.write(data.response[i].uid);. Help me solve the problem.

how to pass a value from the foreach list in javascript by click

The list of events is unloaded from the database and it is output via foreach. The list is sorted by date, but the event IDs ... nt).onclick = function() { document.location.href = "/timetable-mk?record_mk=" + id_event; } </script>

validate js validation fails with ajax

I have an ajax request, and validation (validate js plugin). The validation itself does not work. Help please. It works here, ... Goal ('svyaz_to'); return true;" class="btn btn-block">Перезвоните мне</button> </form> </section>

Send a post request to a third-party site and get a response

Is it really possible to make javascript run at the click of a button, which would send a post request to a third-party site and receive a response? If not, what methods can be used to do this?

Sorting an array in ascending order with numbers and symbols

Imagine that there is an array: arr['A100', 'A3', 'Z100', 'Z2'] I need to write an ascending sort, in which the array will take the following form: arr['A3', 'A100', 'Z2', 'Z100'] I can't think of a way to write a sort.

SVG Animation of the gradual appearance of stroke-dasharray

After repeated attempts to animate a circle with the stroke-dasharray property, I came up with a variant of nesting circle in ... parts. I want to make an animation of the unfolding of the block, but so that all this is in parts (see the second object).

Add a class to jQuery

For a diva <div class="right"> <h2>Новости</h2> <div class="news-teaser floatbox"> ... should be added to the element that the mouse is hovering over, but the script does not work. What's wrong, how do I fix it?

Uncaught TypeError: Illegal invocation

I'm following an example from Flanagan's JavaScript manual and I get an error in Yandex. Browser (read: Chrome): Uncaught Typ ... ьзования объекта range. var r = new Range(1, 3); // Создать новый объект range r.foreach(console.log); // Выведет 1 2 3

Ajax with cookies or Ajax with server authorization

There is a php script on the site that returns JSON for a GET request. You need Ajax to get this data in JavaScript, another ... that if authorization is not passed (i.e. there is no cookie), the script returns null. Q: How do I send Ajax with a cookie ?