Questions tagged as 'javascript'

2
answers

Returning a JavaScript function

When I run the following code the commands that were to be returned in real are not. var a = 0; main = function(_this){ console.log('Está entrando em Main'); return function(){ console.log("Retorno"); //Não escreve o retorno...
asked by 28.07.2017 / 04:12
2
answers

Fetch API can not load [URL]. Response for preflight has invalid HTTP status code 404

Greetings! I am facing the following problem, I make a request [POST] via Fetch API and "call" does not complete. REQUEST VIA Fetch API const requestInfo = { method: 'POST', body: JSON.stringify({ email:'[email protected]' , pass...
asked by 27.07.2017 / 04:24
1
answer

Create component table with Knockout

I have the following code using Ajax to fetch the data in a Restful and loading the fields in a UserList array with knockout: $.ajax({ type: "GET", url: "http://192.168.15.4/api/usuarios", contentType: "application/javascript",...
asked by 04.08.2017 / 04:14
2
answers

Angular filter html

I have an ng-repeat that returns me a list. Every line, I have a default text that appears if a variable is > 0 So far so good. How do I add in the filter only show the record when the default text is filled in? The content is in...
asked by 05.02.2018 / 12:44
1
answer

When can the setSelectionRange method of HTMLInputElement be used?

Studying the structure of an element HTMLInputElement I got to method setSelectionRange , which makes the text selection between the positions defined by the parameters, ie input.setSelectionRange(0, 8) will select the c...
asked by 18.10.2017 / 15:49
2
answers

Get any variable of an array that has a certain id in AngularJS

With the following code, I am saying that in the second array contained in the object $scope.listademercadoria there is the property "quantity", and I am declaring it as value 0. $scope.listademercadoria[1].quantidade = 0; Is there a...
asked by 12.10.2017 / 06:43
4
answers

How to create a randomly select button 3 of 5 numbers

My question is, how to create a button that randomly and automatically selects 3 of the 5 numbers that are shown. Like I clicked on them. Follow all my code below. <html> <head> <style type="text/css"> input[type=checkbox]...
asked by 11.10.2017 / 13:18
2
answers

Algorithm simulation of taximeter

I am creating a Javascript algorithm to do the calculation similar to a tick meter, where you have the time for the flag 1 and the flag 2 . function test(hora,bandeira1, bandeira2) { if (hora >= bandeira1 && hora < bandeira2...
asked by 19.10.2017 / 04:59
1
answer

Resize images by passing the values through the url

In my program downloads site, there are images of various sizes, for example: for each program has a thumbnail, a large image and the screenshots. I just want to make the images all of the same size and by the url pass the size I want from th...
asked by 18.07.2017 / 16:06
1
answer

Resize image with JavaScript

Would you like to build with JavaScript an image-manipulation interface similar to Word, which has the option of enlarging the image or reducing it with the mouse?     
asked by 20.07.2017 / 22:33