Questions tagged as 'javascript'

1
answer

Simple question about for loop

I have 4 images: one image over the other within div . It is over each other because it is in absolute position. I would like to make a simple slideshow , just to learn its basic operation inside a loop . What's wrong with the cod...
asked by 07.06.2016 / 00:37
2
answers

Defined function (not defined yet) in Javascript

(! note: I already looked at this site and in others the answer but I did not find the solution to my problem. Here are some questions I tried to use: Why are you giving "Uncaught ReferenceError: getSetorObj is not defined"? Function no...
asked by 13.06.2016 / 03:20
2
answers

Avoiding successive calls from getElementById with the same parameter

I have the following code: function valida_form (){ var filter_nome = /^([a-zA-Zà-úÀ-Ú0-9]|-|_|\s)+$/ ; if(!filter_nome.test(document.getElementById("input_nome_cad").value)){ document.getElementById("input_nome_ca...
asked by 01.06.2016 / 01:55
1
answer

Set date for 7 days / one week ago

I would like to get today's date, and subtract it 7 days. Remember that if we are on day 2 for example, you should subtract 1 from the month. The same applies to the year. Unfortunately, I only found examples that fit for a specific day, and...
asked by 23.05.2016 / 20:34
1
answer

Setar click for elements not yet existing [duplicate]

$(".item").on('click',function(){ alert($(this).text()); }); count=0; $("#new").on('click',function(){ count++; $li = $("<li class='item'>LI "+count+"</li>"); $("ul").find('.item').last().after($li); }); &...
asked by 15.03.2016 / 14:29
1
answer

Benefit of using template engine

I'm creating cells for tables getting information from an api using append, I wonder if there would be any benefit in using some template engine like Handlebars.js instead of using append? code: function ajaxRank(){ var $orders = $('#orde...
asked by 25.03.2016 / 00:40
2
answers

Back to Previous Page when you get Error

Hello, I have an e-mail newsletter code and when I enter the wrong email address or give some error, I would like instead of redirecting to the registration.html page, it redirects to the previous page, how can I do this? The PHP Code looks l...
asked by 16.03.2016 / 12:40
1
answer

How to change the date format in java script?

I am getting the date entered by the user, which selects from a datepicker . In the form the format is displayed right dd/mm/yyyy , but the problem is when I get the date to play in a variável , it comes as follows: Wed Mar 2...
asked by 23.03.2016 / 20:33
2
answers

It is possible to know that an option was selected in javascript event

I know that it is possible to get the value of a select selected with: $("id option:selected").val() But I wanted to know if it's possible to catch when any of this select is selected via an event, such as selecting a optio...
asked by 24.08.2018 / 15:47
3
answers

Javascript / Jquery - Calculation of days between two dates "DD / MM / YYYY" [duplicate]

Friends, good afternoon ... next, the code below, takes two dates in a calendar, in the format of DD/MM/YYYY $('.two-calendars').on('pickmeup-change', function (evt) { var range = pickmeup(this).get_date('d-m-Y'); if (range...
asked by 15.08.2018 / 19:58