Posts by Stan • 435 points
27 posts
-
0
votes1
answer472
viewsA: Format number with javascript
Solved, I used parseFloat(Math.round(number / 100)).toFixed(2)
-
-1
votes1
answer472
viewsQ: Format number with javascript
I have the following value: 7500 How do I get that value as a final result: 75.00, would like to use pure javascript only. Other examples: 76000 > 760.00 1600 > 16.00 I tried toFixed but it…
-
2
votes2
answers205
viewsQ: Best way to generate a dynamically read with pure javascript
Hello, I have the following structure <li class="col-md-4"> <figure> <a class="list" href="#"><img alt="" src="image.png"></a> <div class="color">…
javascriptasked Stan 435 -
1
votes3
answers96
viewsQ: Compare inputs with the same class and no id
Hello, I have the following structure <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <table> <tr> <th>Valor1</th>…
-
1
votes2
answers232
viewsQ: Sum json object with pure js
I have the following object json1:{A:1, B:2} json2:{A:4, C:3} How do I make the json1 receive the data from json2, replacing if he finds an equal key and moving if he doesn’t find it, more or less…
javascriptasked Stan 435 -
0
votes0
answers27
viewsQ: Track upload progress using Base64
I have the following code function readFile() { if (this.files && this.files[0]) { var FR= new FileReader(); FR.addEventListener("load", function(e) { document.getElementById("img").src =…
-
0
votes1
answer94
viewsQ: Best way to capture an upload’s progress
Hello, I would like to know the best way to capture the progress of an upload using Xmlhttprequest .
javascriptasked Stan 435 -
2
votes1
answer80
viewsQ: Make code that uses Promises work also on older browsers
I recently asked that question: Wait for the variable to be completed The moderator Sergio helped me with the issue, but I’m still having problems with compatibility with old browsers. There is a…
-
0
votes2
answers293
viewsQ: Set object key by a variable
I have the following object Perfil1 ["Souza", "4", "3"] Perfil2 ["Pedro", "2", "1"] Perfil3 ["Lucas", "5", "8"] and a range from 1 to 10 how do i change the profile number of each key according to…
javascriptasked Stan 435 -
2
votes1
answer191
viewsQ: Wait for the variable to be completed
Hello, I have the following array [""Lucas", "pedro" ,"Joao"] I need to submit a request with Xmlhttprequest for each name, then save the answer in json of the 3 in an object and call another…
javascriptasked Stan 435 -
2
votes1
answer499
viewsQ: Best way to store a JSON
Hello, I get a json on this request template { "alunos":[ { "ID":"1", "Nome":"Pedro", }, { "ID":"2", "Nome":"Lucas", }, { "ID":"3", "Nome":"Joana", } ] } I would like a good example of how to store…
javascriptasked Stan 435 -
1
votes2
answers121
viewsQ: Execute code inside Event Listener
Hello! How do I execute a code inside the event listener programmatically? Example: document.getElementById("voltar").addEventListener('click', function() { alert("teste"); }, true); I want to…
javascriptasked Stan 435 -
1
votes2
answers243
viewsA: How do I capture the value of this input when I click enter in input and without using form?
You can use Eventlistener to listen when a key is pressed and keycode to check which key is, and then Xmlhttprequest to send to php Since you didn’t say if you use jquery, follow the example in js…
-
2
votes2
answers109
viewsQ: Warn when time is different from time
Hello, I have two vars storing two times in format minutos:segundos:milisegundos: var tempo1 = "11:10:10"; var tempo2 = "11:10:10"; I would like to generate a warning when the tempo1 is right…
javascriptasked Stan 435 -
1
votes1
answer1242
viewsQ: Calling function within another
I have the following code function nomes() { function funcao() { alert("teste"); } function funcao2() { alert("teste2"); } } <input class="todas" id="checkall" type="checkbox"…
javascriptasked Stan 435 -
1
votes1
answer72
viewsA: Giving Hover one element and changing the other is not working
I did it in pure Js and it worked, but it is much more feasible to do it in pure css You did it right, you just had to put one "+" #title { font-size: 100px; } #imagem:hover + #title { font-size:…
-
2
votes1
answer662
viewsQ: Mark all checkbox with pure js
I put a Function to mark all checkboxes, in a script that Isac developed in a previous question, but it does not work in conjunction with Function, only in a static html. function all_check(marcar)…
javascriptasked Stan 435 -
-1
votes2
answers42
viewsA: Is there any way you can use volume buttons to browse the site?
Man, to my knowledge it’s not possible You would have to have a special permission to access the hardware, it’s not something you’ll get on a web platform
javascriptanswered Stan 435 -
-2
votes1
answer183
viewsQ: Xmlhttprequest Good example applied
Hello, all right? I’ll explain my question I have a multi-name array to automate a customer list and need to send one by one on a get request Example site.com.br/api/registration/user/ >name I…
javascriptasked Stan 435 -
1
votes1
answer62
viewsQ: Wait to fill Function
I have the following Function sistema('/comando2'); //estou chamando assim sistema(cmd) { if((req.state == 4) && (req.status == 200))//verifica a request do XMLHttpRequest {…
javascriptasked Stan 435 -
1
votes1
answer499
viewsA: How to log into a website using PHP+Javascript?
Hello, the best way to do this is by using CURL You can use this library to do this https://github.com/minkphp/MinkGoutteDriver It has several examples, and documentation on the site, I’ve used to…
-
0
votes1
answer63
viewsQ: Calling Function
I’m starting in javascript and I’m having a question. What is the best way to pass instructions to a Javascript Function, I will give a current example of the way I am doing, works, but is a good…
javascriptasked Stan 435 -
0
votes1
answer32
viewsQ: Generate Separate Length for each object
Hello, all right ? How do I generate a corresponding number for each Object, example { "api": "api", "List": [{ "tipo": "1", "data": "10/10/2017", "Hora": "11:38", "Size": "0", "Nome": "Marcelo" },…
javascriptasked Stan 435 -
0
votes1
answer148
viewsQ: Javascript does not recognize Json
I have the following idea that the moderator Sergio sent var obj = [JSON] var mydiv = document.getElementById("tabLista"); mydiv.innerHTML = ""; var ul = document.createElement("ul");…
javascriptasked Stan 435 -
1
votes2
answers303
viewsQ: Change background by clicking the checkbox
I have a structure just like this <ul id="nomes"> <li class="classli"> <div class="Nome">Pedro</div> <div class="data">13/09/2017</div> <input class="check"…
javascriptasked Stan 435 -
2
votes2
answers179
viewsQ: Perform multiple GET with Xmlhttprequest
how do I get Xmlhttprequest to send multiple requests using a list with pure js, example: I have the following list of names Fernando Lucas I want to take this list and post one name at a time and…
javascriptasked Stan 435 -
1
votes1
answer33
viewsQ: Short does not recognize entire date
Hello, how do I make the short recognize the whole object { "Dir": "Sd:/", "List": [ { "Tipo": "P.O.S.-", "Data": "11/10/2017", "Hora": "23:58", "Size": "0", "Nome": "Arquivo1" }, { "Tipo":…