Questions tagged as 'javascript'

2
answers

Why type = 'date' does not work in Firefox?

I was testing a script to calculate interest and realized that my code does not work in Google Chrome , but if I open the same script in Mozilla it works perfectly. What can it be? elementsArray = document.querySelector...
asked by 16.10.2017 / 19:46
2
answers

How to use an input checkbox in the angular using Array?

I'm trying to use a Array in a input[type=checkbox] with Angle 1, but I was not successful. angular.module('app', []) .controller("Ctrl", function ($scope){ $scope.campos = [{nome: "Brasil"}, {nome: "Argentina"}, {n...
asked by 31.07.2017 / 18:28
2
answers

Access this within event

How can I access the this relative to my object, when it calls an event? When the event is called, this becomes the event itself, window.event Ex: function Foo() { this.bar = function() { console.log('Hi!')...
asked by 26.07.2017 / 00:05
4
answers

How to check if a String completes another?

I would like to know if there is any function or operator that can check if a String looks like another in javascript for example: var str1 = "joao foi ao mercado"; var str2 = "joao fo"; What I need is to compare the first with the second o...
asked by 14.08.2017 / 20:55
2
answers

Serve libraries with CDN or own server?

For performance purposes it is more performative to use a CDN (which provides the full and primary version of the library) or distribute versions of Custom Libraries (ex: jQuery UI which provides only the accordion effect). I...
asked by 28.05.2015 / 15:57
5
answers

How to select with Regular Expression a full xml / html tag even though there are equal tags internally?

I'm trying to do the following treatment in a string in javascript using ER (Regular Expression): With this input: um <b>negrito<b>negrito interno</b>externo</b> aqui <b>negrito</b> <i>italico</...
asked by 12.06.2015 / 14:48
3
answers

How to humanize dates in javascript

Given a date ex: 5/24/1982, how to turn into years, months and days? In the above example it would be converted to 33 years 1 month and 1 day. The idea is to do everything in Javascript.     
asked by 25.06.2015 / 14:38
2
answers

Comma-separated sentence in an IF Javascript would have what purpose? "If (1, 2) {}"

By accident when I was changing a Javascript code I made, I put a comma instead of || in a if expression. I changed if (that.busy || that.completed) return; to if (that.busy, that.completed) return; unintentionally...
asked by 02.12.2016 / 11:59
3
answers

Calculate average between 3 notes

I need the user to enter 3 notes to calculate the media and report whether it is approved, disapproved, or recovered. I believe the error is in the average itself. <html> <head> <title> </title> <script type="te...
asked by 16.10.2016 / 00:41
1
answer

Why does Facebook's XHR requests have this code?

I was analyzing Facebook's XHR requests for study purposes and I came across a code that I found to be curious. Inthelinksimilartothis4-edge-chat.facebook.com/pull,ithasthefollowingcode:for(;;);{"t":"fullReload","seq":3} Well! As far as I...
asked by 14.01.2015 / 12:44