Questions tagged as 'javascript'

4
answers

Input Mask

I'm having trouble creating a mask for registration input. Enrollments are made up of 4 or 5 digits, hyphen, 1 digit. (0000? -0). The mask should be applied as you type input . But I could not do it using Javascript pure....
asked by 07.12.2017 / 21:46
1
answer

generate json within loop

I need some help: I have the following json var jsonString = "{ \"0%\" : { \"margin-left\":\"-0%\"},"; jsonString += " \"25%\" : { \"margin-left\":\"-0%\"},"; jsonString += " \"30%\" : { \"margin-left\":\"-100%\"},"; jsonString...
asked by 29.10.2017 / 21:38
1
answer

Change src attribute of an image when uploading via file type input

Hey guys, blz? I need a code that when uploading an image via input file type it is displayed in a preview type. What I have so far is this: HTML: <div class="card"> <img class="card-img-top" src="<?=$foto?>" id="fo...
asked by 03.11.2017 / 20:21
1
answer

Sorting object in javaScript

I need to sort the following object in descending order and after that I should delete everything that comes after "_" and even it, to see which word is formed: Here's what I've done: var str = 'string muito grande para o comentário'; var c...
asked by 05.12.2017 / 21:43
1
answer

select not working correctly

I'm facing a problem, of which I did not find tutorials clear enough on the internet so I could learn how to solve it, which apparently seems simple but I can not solve it. The problem is to get <select> down when you click it. Howe...
asked by 30.11.2017 / 19:08
3
answers

Make appear and disappear html class by js

I have a registration page, and when the data is entered wrong, a alert(); appears informing the error, but I would like it to be an error message, just below the fields. I put a span with an error message and with the class sr-only...
asked by 06.12.2017 / 16:57
1
answer

Make json remote in string

How can I return the value of a remote json and read it as a string, eg when I get json it prints the entire result as in the image below. codebelow:varhttps=require('https');varoptionsget={host:'the-evie.com',port:443,path:'/playerscript/pc/Dr...
asked by 19.09.2017 / 07:00
2
answers

How to know the version of the user's operating system using Javascript?

I would like to know if there is a way to make it so that when the person enters my HTML page, already identifies which operating system it has, and then enables certain buttons. For example if it has Windows 7, the program for windows 8 will...
asked by 01.09.2017 / 21:15
3
answers

How to call a html function

I have a site in html where the purpose was to update a half-second image in half a second with a new one. Same as video surveillance. But I needed to know how to call the function in html for the image to change. It may seem like a very w...
asked by 30.08.2017 / 10:38
2
answers

How do I make / disappear a button only from one of the ng-repeat loops? (Programming in AngularJS)

My angle code has ng-repeat as follows: AngularJS: angular.module('meumodulo', []) .controller('mercadoria', function($rootScope, $http) { var ctrl = this; $rootScope.listademercadoria = []; $rootScope.mercador...
asked by 23.09.2017 / 04:54