Questions tagged as 'javascript'

1
answer

Is it possible to save the canvas as image, and send it to the server?

Let's say I have code similar to this: <html> <head> <style> .centralizado { position: fixed; top: 50%; left: 50%; transform: transla...
asked by 07.05.2017 / 11:07
1
answer

Is there a difference between "variableX: function () {...}" and "variableX = function () {...}"?

Exemplo.prototype = { minhaFuncao: function() { this.variavelX++; } } I've found this : signal apparently acting as an assignment sign ( = ), but I'm not sure if it acts as a token of assignment or if it acts diffe...
asked by 13.02.2018 / 10:42
1
answer

Add value with angularjs in ng-repeat

I have the following code: <li ng-repeat="gasto in gastos"> R${{ gasto.valor }} - {{ gasto.descricao }} </li> This prints on the screen the expenses and the description, but I would like to add the expenses, that is to make...
asked by 08.02.2017 / 03:01
1
answer

Replace Javascript (How does it work?)

Could someone explain how Replace works? I'm trying to count the number of characters entered by a user in the zip code, but it is with Mascara, and there the blank fields are with _ (Underline). I tried to do so to remove the trace and i...
asked by 16.12.2016 / 22:51
1
answer

JavaScript that displays how many months weeks days hours minutes minutes have in x hours

I'm trying to put together a script that transforms a quantity x of hours into months weeks days hours minutes minutes I have a problem with all scripts that I find return by ex and you have 1 week it returns 1 week 7 days x hours and so on....
asked by 20.12.2016 / 03:57
2
answers

How to change the select text after an option is chosen?

I'm making an application where the user should select their ddi . ddi is in select as follows: <select name="paises" id="ddi"> <option value="55" id="bra">Brasil</option> <option value="1" id="eua">...
asked by 28.12.2016 / 13:14
1
answer

Use .php file instead of .js

I want to use an external .js (JavaScript) file in my project but would like to use PHP code to handle JavaScript within .js . I know the .js extension will treat the file as JavaScript and if I enter <?php ... ?>...
asked by 25.06.2018 / 02:10
2
answers

What data can I get from a user?

I'm creating a landing page that aims to capture as much information as possible from users who can become future customers So far I can get the location by geolocation in javascript (if the user allows) or by the IP on the server I've hea...
asked by 28.07.2018 / 05:39
1
answer

Why suppress zero before the decimal point, as in 0.5 == .5?

Sometimes I see a code in which the programmer has written a non-zero decimal, such as 0.5 being .5 , for example: var decimal1 = 0.5; var decimal2 = .5; console.log(decimal1 == decimal2); console.log(decimal1, decimal2);...
asked by 17.07.2018 / 15:15
1
answer

Use single or double quotation marks for strings in JavaScript? [duplicate]

Is there any difference between writing a literal string in single or double quotation marks? Example: var s = 'texto'; // ou var s = "texto";     
asked by 10.03.2017 / 15:28