Questions tagged as 'javascript'

1
answer

Gruntfile does not correctly rename image paths in CSS files [closed]

My Gruntfile.js is set up as follows: // Performs rewrites based on rev and the useminPrepare configuration usemin: { html: ['<%= yeoman.dist %>/{,*/}*.html', '<%= yeoman.dist %>/views/{,*/}*.html'], css: ['<%= yeoman...
asked by 23.09.2014 / 19:35
2
answers

Is it possible to apply push technology?

I have a system, in which it displays database files, in list form. I query the database every 5 seconds to see if there are new files, and if it has it shown to the user, using AJAX. Why this? To avoid updating the page at all times, to s...
asked by 08.09.2014 / 20:57
4
answers

Show highest and lowest number

Why are you wrong? var n1 = parseFloat(prompt("Digite um número:")); var n2 = parseFloat(prompt("Digite um número:")); var n3 = parseFloat(prompt("Digite um número:")); function maiorDosTres(n1, n2, n3) { if ( n1 > n2 > n3) { alert...
asked by 29.08.2015 / 19:09
3
answers

How can I make a certain class appear "..." after reaching a character limit

I wanted you to get an estimated limit of characters when you reached an estimated limit of% to avoid polluting the screen.     
asked by 16.09.2016 / 16:26
4
answers

How can I do to detect the visibility of an element (without jQuery)?

How do I know if a particular element is not visible with pure Javascript? I know how to do this with jQuery, which looks like this: $('.btn').click(function () { $('#box').is(':visible') ? $('#box').hide() : $('#box').show(); });...
asked by 29.06.2016 / 21:18
3
answers

I do not know what this syntax is

Someone can help me with this structure, I do not know what it is, nor how it works. var variavel = { 'teste1':'1', 'teste2':'2', 'teste3':'3' }     
asked by 30.06.2016 / 22:00
4
answers

Clear the browser cache after uploading version

I have the following scenario: Each month we release new versions for our customers, and most of the time our customers call telling us that X functionality is not working the way it should. Because it is usually running a function that is from...
asked by 26.02.2016 / 16:00
4
answers

Script making too many wrong requests

I am in the following dilemma, which may be simple for many here, however, as I am a beginner, I am experiencing a major difficulty in a system I am supporting ... When you click a button, you run a script that returns data in JSON. However...
asked by 04.08.2015 / 21:51
6
answers

javascript loop with sleep [duplicate]

How would you make a or any loop type show the result respecting the time of 1 second for example between one iteration and another? I tried this and it did not work: for( var i=0; i < 10; i++ ){ setTimeout(function (){conso...
asked by 19.01.2016 / 19:42
3
answers

How do I replace on the last occurrence of a character?

I have a loop that assembles strings in this format: var Sabor[0] = "Mussarela, Calabresa, Cebola"; var Sabor[1] = "Mussarela, Presunto, Calabresa, Tomate, Ovos, Pimentão, Cebola"; But I would like to replace the last comma with an "e"....
asked by 30.05.2014 / 01:47