Questions tagged as 'javascript'

2
answers

Real-time verification of connection status with JS [duplicate]

I'm trying to do a real-time check of the internet connection status using JS, here is my code below: var checkConexao = window.setInterval(function() { if (this.readyState == 4 && this.status == 200) { //Oculta a modal...
asked by 06.02.2018 / 15:47
1
answer

Question: Example of uploading files / PHP

I wonder if there is an example on the internet, that when logging in to an admin account, can send files to a certain account to download the file. For example: a pdf file What can I see to try to do something similar to this? Thank you!...
asked by 24.01.2018 / 18:32
2
answers

Array search by name

Can you use Arrow Function in this example? If so, what would it look like? What is the best way to do value search? var msg = ["Orange", "Melancia", "Abobora"]; var fruta = "Melancia" buscar(fruta); function buscar(str){...
asked by 22.01.2018 / 17:57
1
answer

Organize Json file

I wanted a way to organize this Json file: { "ajuda": { "name":"Ajuda", "category": "Sistema", "desc":"Mostra todos os comandos disponiveis.", "usage":"ajuda [grupo ou comando]" }, "ping": {...
asked by 22.01.2018 / 01:31
3
answers

Put a variable in the value of an input

I have a variable, for example: let exemplo = document.querySelector("#id"); I want to break the value of this variable and put it in value of an input HTML: <input type="text" valeu="receberia o valor da variável exemplo" /&...
asked by 22.01.2018 / 14:57
1
answer

What is the difference between querySelectorAll () and getElementsByClassName ()

Apparently these two functions are similar, which is more performative? Which one should I use? What's the difference between the two? document.querySelectorAll () function funDOM() { var x = document.querySelectorAll(".example")...
asked by 22.01.2018 / 13:02
2
answers

Concatenating items of an Array in a nested loop

I would like to get the items in var a , a two-dimensional Array, and iterate in a nested loop, concatenating everything, to put them in brackets, separated by a slash, as shown by the desired result logo below, which will be stored in...
asked by 22.01.2018 / 02:17
1
answer

How to make a scroll with arrows?

I'm working on a project for an application on a touch screen monitor, and I need to make the layout according to the following image. It will be a list of items, within a div for example, and it will have to be a scroll with buttons ac...
asked by 23.01.2018 / 17:19
1
answer

How to save style inline in a variable?

I need to assign to some variable the inline style of a div, before it can be modified: The example below is what I expect to happen, however I can not force 'top', '100px' on the second button but rather retrieve the original value that is...
asked by 23.01.2018 / 18:33
1
answer

Function returns undefined value!

I'm trying to get the size of an image along with other parameters during upload. <script> function handleFileSelect(evt) { var files = evt.target.files; // FileList object // Loop through the FileList and render imag...
asked by 20.02.2018 / 00:00