Questions tagged as 'javascript'

1
answer

javascript / html counter

I need to make an application in javascript / jquery / html that counts the clicks of the user on the button and when the counter reaches 10 it locks the button and displays an alert, I do not know why it is not displaying. Anyone know?...
asked by 23.09.2017 / 21:35
1
answer

Insert a loop into another loop

I want to intersperse the second with the first. For illustration, I will use the simple example below as a basis: <script> n = 10; for ( var i = 0; i < n; i++){document.body.innerHTML += i;} for ( var i = 0; i < n; i++){...
asked by 09.04.2016 / 05:19
3
answers

Replace is not a function

I created a script to insert a div into the cart in my store, but it is giving it an error in the replace function. Would anyone know why? var $JQuery = jQuery.noConflict(); $JQuery(function(){ var ValorFreteGratis = 299; var PrecoTotal = '{{...
asked by 17.02.2017 / 17:26
3
answers

How can I make a clock with Brazilian time in real time

I want to make a clock with Brazilian time, that whenever it passes a second it shows that it happened, that is to say. It's 14:10:12, 14:10:13 etc ... How can I do this? Thank you     
asked by 14.10.2016 / 19:34
2
answers

Can not read property '0' of undefined, incompatibility with prototype

I'm using a script that sorts an JSON in alphabetical order with an indicative header, as shown in question however I am not able to make it work in harmony with prototype, I get the error: Cannot read property '0' of undefined I...
asked by 18.01.2016 / 01:51
2
answers

Javascript Functions

Well, my code is working, but it's messy, if I try to organize it into functions it stops working: How it works: var navbar = document.getElementById('nav'); document.addEventListener("scroll", function() { var posicaoy = window.pageYOffs...
asked by 03.04.2017 / 15:17
3
answers

How to make custom confirm alert?

Good afternoon I'm looking to make a custom alert with a different design: for example if the user clicks on cancel opens an alert asking "do you really want to cancel" but would like it with a design someone could help me. I have alert but only...
asked by 14.06.2018 / 16:12
3
answers

Functions in JavaScript sharing information? [duplicate]

I would like to know if it is possible for two functions in Javascript to share information that is in one of them. Example: function a(){ var nome = prompt("digite seu nome") } function b(){ alert(nome) }     
asked by 27.11.2018 / 06:35
4
answers

Multiple Choice Question

I have to develop a quiz with javascript, the first part I have already developed that are to pick up the answer of questions with only 1 correct answer, but I am not able to do the second part which are the questions with more than one correct...
asked by 28.11.2018 / 12:48
2
answers

What is the difference of $ ('.boot'). on ('click') for $ (document) .on ('click', '.botao')? [duplicate]

I searched and could not find anything (probably because I do not know how to search). Anyway, does anyone know? NOTE: I do not want to know the difference between .click and .on ('click'), please read both options carefully. What I want to...
asked by 11.10.2018 / 20:16