Questions tagged as 'javascript'

1
answer

Regular expression formatted as internet domain

How to create a regular expression to validate an internet domain? The rules are below: Minimum length of 2 and a maximum of 26 characters; Valid characters are letters from "a" to "z", numbers from "0" to "9" and the hyphen; Do not only...
asked by 22.01.2016 / 20:19
1
answer

Testing the interaction with html and JavaScript using Jasmine is wrong?

JavaScript code has some html interactions like this example: function retornaListaDeItens(argument) { return document.getElementsByClassName(argument); } I use the return of this function to perform operations in JavaScript, performing u...
asked by 27.01.2016 / 01:24
1
answer

How to make a query to a web api, passing parameters using angularJS?

I have the current script: (function () { 'use strict'; var numeros = angular.module("myModule", []) .controller("myController", function ($scope, $http, $log) { var sucessoCalBack = function (response) {...
asked by 09.01.2016 / 04:07
1
answer

Disable button while the form is not valid to not have more than one request and duplicate saved data

I need to disable a button until all form fields are correct. Thank you in advance. $('#btnSalvar').on('click', function (e) { var button = $('#btnSalvar'); button.prop('disabled', true); var v...
asked by 08.11.2017 / 17:52
1
answer

How to capture span content by JavaScript

In the WhatsApp Web, every message sent is stored in a span . I need to assign the value of the last message sent by the caller to a variable, as I do with the contents of the "Send a message" box: var textbox = document.querySelector('#main...
asked by 20.12.2017 / 17:27
1
answer

How to run a script on a page without having to open it in a browser tab or window?

I need to do a web-extension (add-on) that can manipulate DOM elements, existing events and execute scripts in the context of a page in a website. But do I need this to happen in background without the page being explicitly in the user's br...
asked by 25.12.2017 / 20:44
1
answer

How do I convert String to Float in Javascript Core?

I've always been curious to know how conversion from string to float actually works in , so I would like to receive a complete and detailed response explaining what javascript does internally at the time of conversion to produce th...
asked by 21.12.2017 / 13:56
1
answer

How do I know how much of the content was downloaded in an Ajax request?

I need to make that little animation, like on Youtube, of the progress bar that appears at the top. How do I know how much of the content has been downloaded, to have a basis for the progress bar? I did not want to do a "static" animation,...
asked by 22.03.2017 / 10:34
1
answer

Angular Directives with methods of constructing objects

I'm trying to create a directive that is an input that makes an object available in $ scope only if it is successfully created by its constructor method. I want the value to be assigned only to the variable in the scope if it is the result of...
asked by 11.12.2014 / 03:55
2
answers

Problems with $ http and ng-repeat angularjs beginner $$ hashKey

Hello, I'm a beginner in Angular and I'm finding it very nice, my problem is this: I have a ng-repeat that works fine when I get the data source of a javascript variable like this: var alertsq = [ { "alert":"mediun", "nt":"28",...
asked by 10.12.2014 / 00:26