Questions tagged as 'javascript'

3
answers

.is () jQuery - how does it work?

As the function .is () works in jQuery, I've seen it being used in a code, in the code it has a $ lastClicked variable, declared, then a comparison is made (! $ (this) .is ($ lastClicked) ), only I did not understand how .is () works, and what i...
asked by 01.08.2018 / 18:08
2
answers

Warn when one time is different from the other

Hello, I have two vars storing two times in the format minutos:segundos:milisegundos : var tempo1 = "11:10:10"; var tempo2 = "11:10:10"; I would like to generate an alert when tempo1 is dirent (greater or less) in 0.5sec...
asked by 02.11.2017 / 04:42
4
answers

Error with simple calculation in javascript

I'm having trouble making an account using javascript: javascript num1 = $("#num1").val(); // exemplo 2 num2 = $("#num2").val(); // exemplo 50 result = num1+num2; This code results in 250 instead of 52 It looks like it's concatenatin...
asked by 24.03.2014 / 19:34
2
answers

Is it possible to concatenate a jQuery selector with a variable?

I have the following code inside a javascript function that is inside a .php page: if (indice_da_aba == -1) { window.alert('não existe ABAS AINDA'); } else if (indice_da_aba == 0) { $('a[href="#tab_00"]').tab('show')...
asked by 30.10.2017 / 20:34
2
answers

Subtraction of arrays

I have two arrays : A E B A = [1,2,3...] B = [7,5,1...] When I do this subtraction it has the correct subtraction return: console.log(A[0] - B[0]); But when I play in the loop it does not work: while (i = 0) { A[i] - B[i] }    ...
asked by 23.11.2018 / 12:09
1
answer

ng-View does not render content - AngularJS

When I access my index.php, I ask in the configuration of routes of my Angular that it calls the view "index.php" inside the graze "view", but it thinks but it does not render anything in my screen var app = angular.module('app',['ngRout...
asked by 20.12.2014 / 16:00
1
answer

How to identify that the user is in the page of my site with Jquery

I'm making a script to identify if the user is on the site or not, but I have no idea how to do this, could anyone help me? My question is the following, I want to know if the user is on my page, for example if the user goes to another tab as...
asked by 11.04.2015 / 16:10
1
answer

Error in MaskInput Javascript

I'm having problems in a field of a form that is masked through the script below. MaskInput(document.getElementById('xxx'),'9999'); According to the function it should format the 4 characters of the field in numeric format and accepting any...
asked by 08.04.2015 / 03:37
2
answers

Run code only after the setTimeout executes

I want the code to run normally, but when timeout gets the code it will wait for it to proceed, type: Normal code: setTimeout(function(){ alert("Hello"); }, 3000); // OPA UM TIMEOUT alert('continuando'); // só depois do timeout ele d...
asked by 03.04.2015 / 05:46
4
answers

How to access index of a javascript array

When I give console.log to the variable overlays , I have the following return: [Oh, 36: Oh, 37: Oh, 97: Oh, 98: Oh, 99: Oh, 100: Oh, 101: Oh] 0: Oh 36: Oh 37: Oh 97: Oh 98: Oh 99: Oh 100: Oh 101: Oh length: 102 __proto__: Array[0...
asked by 11.02.2015 / 14:41