Posts by RDyego • 391 points
19 posts
-
3
votes2
answers224
viewsA: Function values returning Undefined in Javascript
const1 does not have the definition of a, b, c or d. const1 is a function that has as return (number) the result of an equation ((a*b+c-a)/d), in the case const1(10, 2, 2, 10, 2); returns as value…
-
2
votes2
answers202
viewsA: Hide files from inspect
Dude, you can’t hide these files, but you can "encrypt" js with some "Obfuscator": 1 - https://obfuscator.io/ 2 - http://www.javascriptobfuscator.com/Default.aspx…
-
0
votes1
answer56
viewsA: Javascript problem
From what I saw, to use the Cropper it is necessary to add the following scripts: <script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js"…
-
1
votes2
answers137
viewsA: How to treat Timestamp field return via AJAX?
var timestamp = 1555506548000; // ou Date.now(); var date = new Date(timestamp); var localDateString = date.toLocaleDateString("pt-BR"); // 17/04/2019 Can test here.…
-
1
votes1
answer1173
viewsA: JAVASCRIPT read a TXT file
Using the fetch you can read the file. fetch('arquivo.txt') .then(response => response.text()) .then(text => { const array = text.split("\n"); console.log(array); }) Here an example., see the…
-
0
votes3
answers749
viewsA: Javascript variables in HTML
html: <html> <head> <script data-require="jquery@*" data-semver="3.2.1" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script> <link rel="stylesheet"…
-
0
votes3
answers51
viewsA: This code n creates a <li> with the value specified in the function, what am I doing wrong?
Where has: var position = document.getElementsByName('ol')[0]; Should be: var position = document.getElementsByTagName('ol')[0]; Testing here…
javascriptanswered RDyego 391 -
1
votes3
answers314
viewsA: How to stop fomulário sending with Javascript?
Try to trade: <button type="submit" id="btnVerify" class="btn btn-outline-dark">Trocar senha</button> For: <input type="button" value="Trocar senha" id="btnVerify" class="btn…
-
1
votes1
answer76
viewsA: Javascript function not active in input
$(document).ready(function() { $(".campo-formulario").on("keydown change", function() { var elem = $(this); var siblings = elem.siblings(); if (elem.val().length > 0) {…
-
0
votes1
answer1135
viewsA: Create Qr Code reader with Webcodecam
You are using the "webcodecamjs", the way to use is different from the old version "webcodecam" (without the JS at the end). Old version (link): $('#qr-canvas').WebCodeCam() New: new…
-
2
votes1
answer181
viewsA: How to generate a Javascript Object Array dynamically
$.getJSON("Relacionamentos.json", function(data) { var POE_IDs = data .map(x => x.POE_ID) .filter((v, i, s) => s.indexOf(v) === i); var test = POE_IDs .reduce( (a, c) => { var ATTRIBUTES =…
-
1
votes4
answers761
viewsA: How to simulate onclick checkbox
$(document).ready(function() { toggleCheckBoxs(); // inicia alternando os checks boxs }); function toggleCheckBoxs(){ var checks = $('input'); // checks.map((i,x) => x.checked = !x.checked );…
-
0
votes2
answers95
viewsA: How to put multiple numbers on a var
Try using "filter" with "Math.Sign" var positivos = [7, -5, 6, -3.4, 4.6, 12].filter(x => Math.sign(x) == 0 || Math.sign(x) == 1); // positivos fica sendo [7, 6, 4.6, 12] filter Math.…
javascriptanswered RDyego 391 -
0
votes1
answer259
viewsA: read JSON file with JS
From what I’ve seen, one problem is in this "each" var li = []; $.each(registro, function(index, value) { // aqui deveria ser "registro" em vez de "data" li.push("<li id='" + value.cnpj + "'>"…
-
0
votes2
answers96
viewsA: How to pick the last digit of a number in Actionscript 3
Another way, in AS3 : var qtdd = 758; var qtddString:String = qtdd.toString(); // converte para string var ultimoChar = qtddString.charAt(qtddString.length - 1)); // pega o ultimo character e…
actionscript-3answered RDyego 391 -
0
votes5
answers3984
viewsA: How to compare arrays to javascript?
Follows another form: const check_frutas = ["banana", "uva", "pera"]; const frutas_a = ["banana", "limao", "pera", "goiaba"]; const frutas_b = ["tomate", "tangerina", "pera", "melancia"]; const…
-
0
votes2
answers53
viewsA: Create object from an array
Follows another form: var original = { "17": [{ "data": "2019-03-01", "ofetas": "22.65", "decisoes": "6" }, { "data": "2019-03-03", "ofetas": "55.33", "decisoes": "3" }, { "data": "2019-03-05",…
javascriptanswered RDyego 391 -
1
votes1
answer168
viewsA: Retrieve data from Gridview
In the Function you quoted you can put Debugger; to debug the js code. function pegarDadosGrid(e) { var dados = e.component.getDataSource().items(); debugger; // quando vc chamar pegarDadosGrid, a…
-
1
votes1
answer367
viewsA: Create List in javascript
If you use pure js, you can create an array of anonymous objects, example: var test = [ { nome: 'João', idade: '23'}, { nome: 'Henrique', idade: '18'} ]; or an array of numbers var test = [1,2,3,4];…