Questions tagged as 'javascript'

4
answers

How do I enable a button only when all inputs are filled?

I have a <button> that is rendered as disabled (disabled) when the page is initially loaded. I would like it to be enabled (enabled) when all data is filled in <input> 's. How could I do this using jQue...
asked by 21.02.2014 / 12:41
1
answer

Building a "3D" building with HTML, CSS and JS

How can I reproduce the image below using HTML, CSS and JS (maybe images)? The numbers of "floors" are unpredictable and each "floor" should be "clickable," a <a href="#"></a> , or something like that. Is it possible to...
asked by 18.02.2015 / 16:38
3
answers

How to format a date in 'dd / MM / yyyy' format?

How to get a formatted string from an object of type Date in format dd/MM/yyyy ?     
asked by 18.02.2016 / 13:10
2
answers

Does the syntax '///' have any special meaning?

I was using notepad ++ (v 6.5) to write a file in javascript when I noticed the following: I wrote a comment line starting with /// , three instead of the usual two. In execution this line seems to be ignored, but it is not colored...
asked by 05.05.2014 / 16:55
1
answer

JavaScript ternary condition with only one value

A fairly basic JavaScript question, on a ternary condition how can I do to take action only on an if without the need of the else? Example (test) ? test1() : test2(); If you do not want anything to happen at Else, how would you look?...
asked by 06.05.2014 / 19:45
1
answer

What is the purpose of the "return true" command at the end of a function?

I noticed that in many functions in javascript I see at the end a return true . function EscreveDados(){ document.getElementById("divData").value = 'texto'; return true; } In HTML we have the tag which calls the function fol...
asked by 30.09.2015 / 18:19
3
answers

How do I know if I am on an anonymous or normal chrome page?

I'm making a page html to use locally on my PC with Windows , but I needed some way to know how I'm in the browser Chrome . I wanted to present a phrase that would change depending on the way I was. Example: Incognito...
asked by 02.08.2017 / 12:09
1
answer

Detect AdBlock and display a message

What I'm trying to do is to detect Adblock Plus and display a message.     
asked by 20.09.2015 / 09:35
3
answers

Is there any equivalent of "$ (document) .ready ()" with pure Javascript?

In jQuery, we need to use $(document).ready() to know if the document has been loaded and then safely run our jQuery script. According to the jQuery documentation    A page can not be manipulated safely until the document is "ready....
asked by 29.06.2016 / 21:31
5
answers

What is the shortest and most performative way of writing fibonnaci in Javascript?

Javascript is a language that allows you to write the same thing in several different ways. The best answer should describe the syntax features used to arrive at the goal which is a shortest possible function and a very performative one regar...
asked by 20.03.2014 / 17:27