Questions tagged as 'javascript'

2
answers

Get value from within a function

I have a logic problem here, I think it must be a "dumb" thing on my part, like I have to get a value from within the function, and I'm not getting a return for being an http request. look: $scope.postData = function(method, data, file){...
asked by 10.01.2017 / 14:27
1
answer

How popular is a select with JQuery, JSON and AJAX? (MVC)

I followed some codes that I found here on how to populate a selectbox, but it is not working, is something missing? I'm getting a list of data with my Controller. JavaScript $(document).ready(function () { $(document).select...
asked by 03.10.2016 / 16:53
2
answers

Firebase security

I'm starting to study firebase, I really enjoyed the firebase database realtime for web, but one question that does not come out of my head is, how do I protect my account if the configuration data stays in js? type another malicious person can...
asked by 20.01.2017 / 14:51
1
answer

Count vector elements and put links on the page

I want to make a script that counts how many vector indexes I have inside new Array . Example var array = new Array('001.html', '002.html', '003.html', '004.html', '005.html') .. and add them in the HTML document, right in th...
asked by 31.12.2016 / 15:04
1
answer

How does this regex work in js?

I found on the internet this regex in javascript that formats monetary values in R $: Number( 1450999 ) .toFixed( 2 ) .replace( '.', ',' ) .replace( /(\d)(?=(\d{3})+,)/g, "$1," ) // 1450999 -> 1.450.999,00 I have been analyzing for a lon...
asked by 03.11.2016 / 17:29
1
answer

Javascript - discount from x units [closed]

I've mounted this code, but I can not get it to display the result at full discount from 'x' units: de : <span id="APrecoDe">46.50</span><br><br> por : <span id="APrecoPor">43.50</span><br><br> q...
asked by 01.11.2016 / 17:04
2
answers

Enable field when radio is selected

I'm learning javascript, so I was testing to make a radio that, when selected, enables a text area, and when not selected, disables it. But what I was doing did not work and I did not understand why. That way I would like help to understand t...
asked by 25.10.2016 / 04:21
2
answers

Get JSON value and set AJAX behavior

How to get the value of JSON with ajax and define the behavior of which div and which message to display, for example: If JSON returns {"error":"true","message":"Algo deu errado"} would show any div, "error" for example, with the messa...
asked by 20.10.2016 / 08:36
1
answer

Get an attribute of a class in javascript

Hello, I'm developing a list with all my facebook friends. I was able to create the first line of the code, which causes me to grab all my friends and store them in a variable inside an array, as shown below: var info = document.getElements...
asked by 03.10.2016 / 20:10
1
answer

Is there a way to "mirror" properties from one object to another?

Let's say I want to do a function type debugText(obj) , this function takes an object as a parameter and shows its properties on the screen, such as game debug screens. Something like: function debugText(link,prop) { this.TextObje...
asked by 30.10.2016 / 07:02