Questions tagged [JavaScript] (43914)

2
answers

What do you mean shorthand notation in the function?

I have a function factorial function factorial(n) { return (n < 2) ? 1 : factorial(n - 1) * n; } what do you mean this entry: factorial(n - 1)? As it is differently written? Thanks to all, understood)
Misty_Bernhard83 asked April 19th 20 at 12:49
3
answers

How to work with ajax?

Friends, there's a problem.. Perhaps I'll start with the structure of the boilerplate Ajax calls query $.ajax({ url: window.location.href cache: true, success: function(html){ $("body").html(html); } }); The purpose of this request is to refresh the page after closing the modal window. This approach works fine,...
abbie.Lakin22 asked April 19th 20 at 12:49
2
answers

How to obtain the latest option?

https://jsfiddle.net/tnhrzy2k/1/
rupert11 asked April 19th 20 at 12:48
0
answer

What made the web browser version of Forge of Empires?

What made Forge of Empires? Services definition technology show that it is made on VueJS - is it true? Or something else? and used Canvas. And the server part on these games on what to do. With Node?
mozelle.Hya asked April 19th 20 at 12:48
1
answer

What technologies are used to create browser-based games like FOE?

What technologies are used to create browser-based games like FOE? I understand that all the browser games in JS do. But where to read about the technology, methods, framework can and so on? Understand the question is vague, maybe. But the introductory info where to find? Please tell me
garnett asked April 19th 20 at 12:48
2
answers

How to make a window of gratitude after sending the form, but not through the alert?

Is the form submitting, there appears the window of gratitude, but alert. How to make somehow in another way, not through the alert? submitHandler: function(form) { $.ajax({ type: "POST", url: "send.php", data: $(form).serialize(), success: function (response) { alert(' the Form is submitted, we will contact you in 10...
margarett.Kirlin asked April 19th 20 at 12:48
2
answers

How to do a redirect to the page?

Good afternoon, everyone. Far from programming, therefore, for someone will seem a silly question but still the answer I need. There is code: $(document).ready(function() { //E-mail Ajax Send $("form").submit(function() { //Change var th = $(this); $.ajax({ type: "POST", url: "mail.php", //Change data: th.seriali...
alessia_Robel asked April 19th 20 at 12:48
1
answer

How to enter data into the table with sorting?

Good day! Would like to know how to implement the following functionality. There is a calculator that after clicking the button is formed, the number is displayed in the table. Roughly speaking there is a table in which there are numbers from 1 to 20 and creates a new number, say 12, and it should appear in the table on 12...
deondre_Runolfsdottir36 asked April 19th 20 at 12:48
2
answers

How to make a function that selects randomly the array elements?

Hello! It would seem trivial, but I can't think of how to make a function that will accept as parameter the number of returned elements, and the array from which we will isolate them (sorry)! let arr = [ 1, 2, 3, 4, 5, 6, 7 ]; function getRandom( n, array ) { // n is the number of random elements from array // . . . code w...
haven_Corke asked April 19th 20 at 12:48
3
answers

You can simplify this code?

You can simplify this code to solve this problem? Here is the code: sumsInArray function(arr){ const newArr = []; for (let i = 0; i < arr.length; i++){ let sum = 0; if (arr[i].length === 0) newArr.push(sum); for (let j = 0; j < arr[i].length; j++){ sum += arr[i][j]; if (j === arr[i].length - 1) { newArr.push(...
victor38 asked April 19th 20 at 12:47