Questions tagged as 'javascript'

2
answers

How to change the color of the link when it is on the link page accessed

I see a lot of websites that when someone opens the "ABOUT" page, a CSS that only stylizes that link is activated. I believe it's with JS, and that involves URL comparison, but in practice I have no idea. Suddenly it appears to be a duplicate...
asked by 21.03.2016 / 15:54
1
answer

How to set a menu with jQuery?

I'm a beginner and would like to know the error of this code: var nav = $('.topo'); $(window).scroll(function () { if ($(this).scrollTop() > 136) { nav.addClass("fixar"); } else { nav.removeClass("fixar"); } });...
asked by 21.03.2016 / 23:48
1
answer

auto complete jQuery with 2 input

I have the following autocomplete that works on the 1st input, when it completes it fills the 2nd input. The problem is that if you delete the <p> tag it does not work. Can anyone tell me why? Follow the code: $().read...
asked by 18.03.2016 / 12:06
2
answers

Block special characters but allow hyphen

My code for blocking characters looks like this: $('#nome').on('keypress', function() { var regex = new RegExp("^[ 0-9a-zA-Zàèìòùáéíóúâêîôûãõ\b]+$"); var _this = this; // Curta pausa para esperar colar para completa...
asked by 06.11.2015 / 17:50
3
answers

Remove element focus using pure JavaScript

I want to know how to remove focus from an element when it is clicked using pure JavaScript. I made it that way using jQuery $(function(){ $(".btn").click(function(){ $(".btn").blur(); }); }); This served me well, but I changed s...
asked by 29.11.2015 / 22:00
1
answer

Javascript on page JSF - PrimeFace

HTML code - JAVASCRIPT It read a txt file from the computer and puts its value into an html input <input type="file" id="files" name="files[]" multiple /> <input type="text" required name="txtstart" style="width:150px" value=""> &...
asked by 09.03.2016 / 04:02
2
answers

Change Image and clear cache

I'm displaying on my page an image called punctuation.png , and I'd like javascript to clear the cache and display the image and repeat this every 100 milliseconds. Is this possible? Would anyone help me with an example in javascript and htm...
asked by 11.03.2016 / 21:32
2
answers

How to set maxDate in datepicker for seven days after the selected date?

When a date is selected, the user should be able to select another date within a period of one week after the date that he selected. Here's the code I'm using: $(".datepicker_reservas").datepicker({ minDate: 0, numberOfMonths: [1,4]...
asked by 09.03.2016 / 19:36
2
answers

Convert date from bank in AJAX

I would like to convert the date from the bank (2012-02-10) to Brazilian standard (10/02/2012) in the AJAX success example: $.ajax({ type: 'POST', dataType: 'json', url: "crud/consulta.php", data: dados,...
asked by 07.07.2016 / 04:02
3
answers

Passing a PHP variable to a Bootstrap modal

I have a report ( table ) containing user registrations using the Bootstrap framework. Next to each record line is Edit. Clicking on this option would call the Modal window, and open the information for that record specifically. The...
asked by 05.07.2016 / 21:25