Questions tagged as 'javascript'

2
answers

How to change the opacity of a part of the image?

I'm mapping an image so that when I click on a particular area, another page is referenced in an iframe. However, in order for the user to know where he / she is clicking, I want to increase the opacity of that area and place a text. <img s...
asked by 06.10.2015 / 13:29
3
answers

Index identification changes before time JS

Hello everyone, I have a problem, next I need to create an element and send it via ajax, wait for it to perform (done / fail) and execute an action on that element, but sending and creating elements can be done several times in a row. the return...
asked by 05.10.2015 / 17:21
2
answers

Calculate percentage of total HTML columns with Jquery

I have a table that is automatically generated by PHP and manipulated by jquery, but I need to calculate the percentage of the total of each of the number lines, what is the best way to do this? <div id="tableResults" class="container"&...
asked by 25.04.2017 / 16:23
1
answer

Policy as function parameter?

Is it possible to set directives as parameters of a function already on the html page? I tried to serviceLogin({{login.user}},{{login.pass}}) but I believe it is not the correct one     
asked by 15.10.2015 / 22:07
2
answers

How to test whole arrays in javascript?

Good evening! I need to create a function that accepts an array of numbers and returns true if it contains at least an even number and false , otherwise. The code below even does this, SQN: var ParOuImpar = function(num){ var i, co...
asked by 10.10.2015 / 01:50
1
answer

Code defined to function at a certain time

I have a code that should work at a certain time, but it is not working. $(function() { $(".post").each(function() { var d = new Date(); var hora = d.getHours(); if (hora <= 7 && hora >= 22) {...
asked by 16.10.2015 / 19:55
2
answers

Reset button text via Javascript

Well, I do not know if my title is related to what I'm asking for, but I have a form with an Enter button. <button id="btn_entrar" data-loading-text="carregando..." autocomplete="off" class="btn btn-primary btn-cons m-t-10" type="submit" on...
asked by 19.01.2016 / 12:40
1
answer

Abort an Ajax request

In a situation where I use ASP.NET MVC , can you cancel a AJAX request depending on the response of a modal? I'm doing something like this: function atualizaStatus(sel, id) { var $status = sel.value; var $idAluno = id;...
asked by 20.01.2016 / 14:02
1
answer

Change event is only triggered when changing tab or changing window

Good afternoon guys. I'm trying to implement an autocomplete using typeahead.js. Assign a change event to my input to make an ajax request that brings me the data that will be displayed in the list. However, when the screen loads and I typ...
asked by 20.01.2016 / 17:35
1
answer

How to put weight mask in input using JavaScript

So far I've been trying like this, but it did not work out: $('.peso').keyup(function () { var v = this.value, integer = v.split('.')[0]; v = v.replace(/\D/g, ""); v = v.replace(/^[0]+/, ""); if (v.length <= 3 || !integer) { if (v.lengt...
asked by 22.01.2016 / 17:24