Questions tagged as 'javascript'

4
answers

Ajax request with pure Javascript (without APIs)

Generally, when we need to use Ajax requests using Javascript, we have handy APIs that help us with this (eg jQuery ). However, what would be the safest and cross-browser way to accomplish these requests (POST and GET) using pure Javasc...
asked by 30.01.2014 / 16:15
4
answers

Cross-browser way to copy text to Clipboard

I'm looking for ways to copy a text to clipboard via JavaScript, which works in most modern browsers, but there's too much information and it seems outdated. I know there is the Clipboard API and that it is partially supported by all (except...
asked by 25.05.2014 / 19:41
3
answers

What is the "with" in JavaScript?

What is with in JavaScript? Does it only work to get object values as if it were a variable, or is it also possible to set or change properties through it? Example: var obj = {nome: 'Stack Overflow'} with (obj) { console.log(no...
asked by 02.03.2015 / 13:59
4
answers

What is console.log?

I see this in some JavaScript files: console.log(algumaCoisa); console.log("alguma coisa"); What is it good for and how does it work? I'm trying to make a custom log() for a Userscript (see How can I log information without using...
asked by 24.10.2014 / 19:21
1
answer

Counter of characters typed in a textarea

I have this text box to be validated, should I enter the amount of remaining characters and display these remaining characters in the span, could they help me? <div class="novaLinha"> <div> <label for="txtVoce">...
asked by 13.02.2016 / 21:03
1
answer

File upload callback with Multer - NodeJS

Hello, has anyone used the multer (express / nodeJS module) to perform file uploads? If yes how did you catch the callback events (onFileUploadStart and onFileUploadComplete)? Theoretically I'm using correctly but at no time are events called .....
asked by 27.07.2015 / 22:16
1
answer

Add new element to array

I have a multi-contact directory, where each contact can have one or more dynamic fields. You can define the name of these fields, and they are different between the contacts. For example, if Contato 1 has the campo 1 field,...
asked by 28.07.2015 / 20:02
1
answer

Can you calculate the diagonal on Canvas?

I need to draw a square with Canvas in an image. This image comes from the database, where it has different dimensions. I am able to draw the square in the center of the image, but if the image is wider, the Canvas is out of proportion. Is it po...
asked by 24.06.2015 / 15:56
1
answer

Cancel Uploads

I'm trying to upload imagens files, but when I'm clicking on X of Photo Preview, it's only closing Preview, but it's still selected. How can I do when I click on x , also that list image is taken? My JS code just below....
asked by 25.06.2015 / 21:27
1
answer

Refresh page information without refreesh

I have already searched and did not find exactly what I want. My problem is this: I have a comment page that I wanted it to be updated with every change in the bank (this is for everyone who is currently logged in). I found some methods on...
asked by 22.12.2015 / 01:59