Questions tagged as 'javascript'

2
answers

How to check if a number is decimal?

Is there a way to tell if a number is a decimal, that is, if it contains a "comma"?; A code I found was this: Html <input type="text" onblur="isNumber(this.value)" id="text" /> JavaScript function isNumber(text){...
asked by 05.08.2014 / 22:45
2
answers

Why is my function concatenating instead of adding the numbers?

I'm learning JavaScript and I'm breaking my head with this code I created. Why is my function concatenating instead of adding up the numbers I store in variables? <!DOCTYPE html> <html> <head> <title>Aula 05 Java Sc...
asked by 30.04.2016 / 21:55
3
answers

Convert array of objects to array of arrays

How to perform string conversion (array of objects): [ {"id":1,"nome":"Maluf","cpf":"007.519.591-20"}, {"id":2,"nome":"Paulo Ricardo","cpf":"565.232.591-02"}, {"id":3,"nome":"Joaquim Barbosa","cpf":"007.519.699-32"}, {"id":4,"nome"...
asked by 29.12.2015 / 17:15
1
answer

JavaScript: Differences between import and require

I know that import and require are used in JavaScript to import functions or third-party objects. It is common for code snippets like: import Library from 'some-library'; or const Library = require('some-library'); Howeve...
asked by 20.06.2017 / 04:37
3
answers

Abort AJAX request

I have a question. I need to cancel an AJAX request on the client side and on the server side. On the client side I use abort() var requisicao = $.ajax({ url : 'xyz.php' }); if(requisicao && cliente_abortou_requisicao){...
asked by 07.11.2016 / 19:05
1
answer

Count number of PDF pages with JavaScript

I am generating a PDF file with reports generated through PHP. In the PDF file, an x number of reports is generated and each report has a number of pages. I need to know if this number y is even or odd, if it's odd I need to add a blank page....
asked by 25.08.2016 / 14:34
1
answer

$ e $$ are now browsers' native functions?

When using the console on a page without JavaScript, I noticed that typing $ had the same effect as document.querySelector and typing $$ had the same effect as document.querySelectorAll . Would two functions shortcu...
asked by 24.04.2017 / 23:07
3
answers

JavaScript - Thread, Asynchronous, Ticks

Situation Studying about Thread , I understood that they are lines of execution within a process. Studying about Assincronismo em javascript , I understand that it does not support multiple Thread , but has loop de ev...
asked by 12.11.2015 / 13:55
5
answers

Update list after push AngularJS

I have a list with several data ( $scope.messages ), but only some data interest me. After loading this list I make a foreach and get only the data that interest me and give push to a new list. This way: angular.forEach($sc...
asked by 19.11.2015 / 20:09
3
answers

Extract data from txt file to use in autocomplete

   Update: Just for the record, you do not need to use jQuery-ui, it might be another solution. I'm creating a autocomplete for a form, which should include all the options of the CBO - Brazilian Code of Occupations Unlike the zi...
asked by 10.04.2015 / 18:16