Questions tagged as 'javascript'

2
answers

How to add option to a select by Jquery / Javascript

I'm trying to create a select that gets its options via JavaScript or jQuery, the data is stored in an array. Example: for (i = 0; i <= cidades.length; i++) { $('select').append('<option>' + cidades[i] + '</opt...
asked by 14.10.2015 / 00:42
1
answer

How to insert a watermark in PNG

Following this example, I would like to be able to use a png in place of the banners on the canvas: link I'm using this code as a study, because it's all commented out, so my question applies to exactly this code: /* @preserve *...
asked by 23.09.2015 / 00:25
1
answer

In which part of the application is it most appropriate to reorder an array (database, server application, client code)?

Let's suppose that in a MYSQL database query, I need to pick up the last 1000 data that was posted, but within those results, the order must be growing (not descending, as would happen in ORDER BY ID DESC Limit 1000 ). The response of...
asked by 16.10.2014 / 13:41
3
answers

How to style a select only with Javascript without Jquery?

I know that jQuery UI has method selectmenu() , what would it be with pure Javascript? Not only the select button where you will open the options, but also the window containing the options, including borders ... For ex...
asked by 07.10.2016 / 19:41
4
answers

Empty input can not receive zero value

I have a form with more or less 5 inputs , at any given time any of these inputs will be worthless, and I want to find out the lowest value between them, but whenever it has one or more empty inputs it returns the value 0 and indicates that...
asked by 10.11.2016 / 12:21
2
answers

Know idle mouse time

I have an intranet system, which sellers attend some classes. Sometimes they leave the window open at that URL for days. The system via ajax has a counter, so if the page is open, it will be requesting and recording on the bank that the fa...
asked by 05.12.2016 / 18:56
3
answers

Redirect page if it has resolution less than 767px [duplicate]

Searching the internet, I found this question here in SOpt: Redirect to mobile site In the question was a code that redirects a page if it is accessed by some mobile device. I'm using here and it works normally. I thought it would...
asked by 28.10.2016 / 01:50
1
answer

Mask for monetary values

I wanted to create a mask for monetary values, where the person would enter and enter the scores and separations of the decimal places automatically. Ex:    $ 1       R $, 11       $ 1.10       $ 11.00       $ 110.00       $ 1,110.00...
asked by 11.11.2016 / 18:10
3
answers

convert integer to decimal in jquery

I need to convert for example the value "025" for "0.25" or "005" for "0.05" : I'm trying to do it like this: var valor1 = $("#ValorDesconto").val().replace(/[^\d]+/g,''); parseFloat(valor1).toFixed(2) How do I? the way I did abov...
asked by 29.09.2016 / 21:40
2
answers

Scroll down the page when restarting with JS

I was hoping that when the page was loaded, it would automatically go to the end of it. I do not want to use jquery because the project is relatively simple. It is not necessary. I used the following code: <body onload="toBottom();"> &l...
asked by 02.12.2016 / 18:47