Questions tagged as 'javascript-eventos'

1
answer

.click function being executed twice

I have a $ (".btn-buy") .click () function that, when I click it, it runs twice. I can not solve the problem. I've researched the whole code and it has no duplicity. What can it be? Function: $(".btn-comprar").click(function () {...
asked by 18.06.2016 / 23:58
1
answer

$ .get callback is not called and I can not debug to find out the reason

I'm developing a mobile application (with cordova) that needs to do a select in the BD online, and with this data update the mobile phone's DB, however I came across a problem, I perform the select in the DB of the mobile phone after performing...
asked by 01.07.2015 / 17:56
1
answer

onload event for iframe [duplicate]

Question Let's say that on my site I have iframe reserved to load a possible external page, and this iframe is with display:none , as I could create in callback to fire at the end of loading this page, to make a...
asked by 24.01.2017 / 17:30
1
answer

event on the property or use addEventListener

One thing I've always wanted to know, is whether to use addEventListener or the property of the <body onload=""> tag. Some say it's addEventListener and some say it's property. Does anyone have an OFFICIAL answer? I...
asked by 17.04.2015 / 18:57
1
answer

ES6 and addEventListener (). Why does not this method take reference to an anonymous function?

Why is the 'click' not invoked? $elemento.addEventListener('click', click, true); var click = () => { ... };     
asked by 02.02.2017 / 13:51
1
answer

How to execute a JAVASCRIPT code by PHP without event

Next, I'm trying to replace alert with modal that of jquery that uses jquery. In case I'm using the first example: <div id="ex1" class="modal"> <p>Usuário ou senha incorretos.</p> <a href="#" rel="modal...
asked by 23.07.2018 / 06:49
1
answer

Event with and without addEventlistener are not the same?

Because this does not work: window.addEventListener('beforeunload', function(){ return 'wait a minute' }) And this works: window.onbeforeunload = function(){ return 'wait a minute' } Are not they the same thing?     
asked by 16.12.2017 / 19:50
2
answers

How to manipulate the order of Event Listeners of a DOM element

I have a link: <a href="foo" class="foo">go to foo</a> First event handler ( main.js ) document.querySelector('.foo').addEventListener('click', function( event ) { console.log(1); }); In another script, I add the second...
asked by 07.08.2015 / 21:58
1
answer

Generate a new JSON by manipulating the data of another JSON

I was participating in an internship test and the following problem was proposed to me: I would have to read the JSON below: [ { "nome":"Jabba, the Hutt", "jedi":false, "sistemas":[ "Tatooine" ] }, { "nome":"Chewbacca", "jedi":false, "sist...
asked by 03.09.2018 / 21:37
1
answer

Problem with post / get method to update table

I'm trying to perform an Update on my table through javascript so I do not have to leave the screen every time I inactive a field, my table: ThebuttonIusedinPHPbutwenttoanotherpage:<tdclass="center"> <?php echo"<a class='btn bt...
asked by 19.11.2018 / 12:27