Questions tagged as 'javascript'

1
answer

Unknown symbol javascript

I am learning javascript and downloaded the Olw Carousel and I went to see the js and at the beginning of the script there is this excerpt ;(function($, window, document, undefined) What intrigued me was this point and comma in the beginn...
asked by 03.01.2017 / 09:47
2
answers

Problem in javascript resolution [closed]

Should not the code below be executed automatically by getting the values of the id's and assigning them to the array ui? var ui = ["input", "prompt", "heading"]; ui.forEach(function(id){ ui[id] = document.getElementById(id); });     
asked by 03.01.2017 / 10:22
2
answers

Create object with array of internal objects

I'd like to create a "cast" object (maybe a class, maybe a function), with possibly other objects inside it, and arrays . The structure I imagine is like this: postagem: { titulo: "", autor: "", texto: [ { linh...
asked by 23.05.2017 / 04:25
3
answers

Run a function while holding button, stop when releasing

How to execute a function when the user hold a button and stop executing when the user releases the button. As in WhatsApp when you are going to record an audio ...     
asked by 31.05.2017 / 16:25
1
answer

How to move characters with mouse?

I'm developing a time spent (browser game), where the user will guide your plane through the scenery! I have 2 div , at first I create a rectangle where when moving the mouse I capture the axis X and Y , I need to move a character in...
asked by 25.02.2016 / 18:26
2
answers

Compare equal dates in javascript

With reference to these two questions: Simple Comparison Between Dates How to compare two dates in Javascript or jQuery I need to compare the dates and I need to distinguish three dates between two dates, either being equal or...
asked by 02.03.2016 / 13:50
2
answers

Firefox API audio compatibility issue

I'm using the API to issue some sounds, the problem is that in Firefox I can not run mp3 , but how can I do to include other formatting in this code? How can I do to add another ogg font for example? I'm using API to call Audio like...
asked by 08.12.2015 / 03:09
5
answers

localhost does not have access to the requested page

I'm trying to access a URL in AJAX but is giving the following error:    XMLHttpRequest can not load link . At the   'Access-Control-Allow-Origin' header is present on the requested   resource. Origin ' link ' is therefore not...
asked by 15.12.2015 / 12:18
2
answers

What are the differences between "type = button" and "type = submit" in an input?

I have a simple JavaScript code to add a string to a ul list: JS: function init() { var botao = document.getElementById("addButton"); botao.onclick = handleButtonClick; } function handleButtonClick() { var textInput = d...
asked by 20.08.2015 / 21:50
2
answers

How do I expect everything to load before running a function?

How can I delay a function, since the checkboxes are generated dynamically in the conventional way in javascript, and only run after the entire page has been rendered and the other javascripts have been executed? I'm trying to use this code:...
asked by 14.08.2015 / 04:05