Questions tagged as 'javascript'

4
answers

How to send text to the printer with PHP and Javascript?

I need to print text that is not necessarily contained in the html document on a printer installed on the client, I need to open that window to select printers and etc and send the printout. // EDIT In case the printout would be sent to a...
asked by 11.02.2014 / 12:02
5
answers

Stay showing the date and time in the browser with javascript

Hello. I want to display the date and time on the page. For this, I started by doing the little test to display a countdown: var tempo=60; function session(time) { time=this.tempo; if (this.tempo>0) { tempo--; docu...
asked by 18.08.2015 / 14:31
3
answers

Get timestamp

I have two variables, one with the date and another with the time. How can I get your timestamp of the two variables. Example: var data = 02/01/2015; var hora = 10:00:00; var d = new Date(data + hora); d.getTime();     
asked by 06.01.2015 / 17:29
2
answers

Export to excel via javascript, put name in file

> function ExportToExcel() { var htmltable = document.getElementById('exportdata'); var html = htmltable.outerHTML; window.open('data:application/vnd.ms-excel, ' + encodeURIComponent(html));...
asked by 13.12.2016 / 22:20
2
answers

Why is it necessary to use bind when working with ES6 and ReactJS?

Using ES5 in development with ReactJS, a component can be declared as follows: var MyComponent = React.createClass({ alertSomething: function(event) { alert(event.target); }, render: function() { return ( <button onClic...
asked by 06.05.2016 / 15:46
2
answers

How to check an attribute of type object in Javascript?

I get the following object: obj = { fernando: { nome: 'Fernando', idade: 21 }, tiago: { nome: 'tiago', idade: NaN }, total: 2 } As you can see, I get an object where each attribute can be...
asked by 21.12.2016 / 19:36
2
answers

jquery syntax error

Hello, I'm having a problem with using this code. I want to find the following code in the div with class output: I used append, here is giving syntax error, could you help me? > $('.output').append('<li class="canal row"><div class...
asked by 05.06.2017 / 21:11
1
answer

How to find out the rendered size of a curve in html5 canvas 2d?

I need to figure out the rendered size of a curve on 2d canvas context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); with this code, for example // pontos de controle var cp1x = 200, cp1y = 150, cp2x = 260, cp2y = 10; var x =...
asked by 08.09.2016 / 13:36
1
answer

HTML Custom Attributes

I am developing a system for managing public tenders and I need it to be compatible with as many devices as possible. In some situations it was necessary to use custom attributes, for example: <span qtd='20'>Alguma coisa...</span&g...
asked by 17.03.2017 / 18:08
3
answers

What is the difference between parseInt and + operator before a string?

I've seen a colleague converting a string to integer using the var a = +"10" f syntax but I've always used parseInt() and the line is usually var a = parseInt("10") . Why putting the + operator before a string happens,...
asked by 01.10.2018 / 14:41