Questions tagged as 'javascript'

2
answers

Confused about correct way of inheriting JavaScript

I'm looking at ways to apply Object Oriented in JavaScript. I noticed that there are several ways to do Inheritance in JavaScript. I did the one I found simple and worked. But is it really within the standards? is correct? Follow the Code:...
asked by 27.11.2014 / 14:54
2
answers

Default to typify errors / exceptions?

As far as I know, JavaScript has no error typing. In C # and Java, it is possible to do things like: try { /* .. snip .. */ } catch (FooException foo) { /* .. snip .. */ } catch (BarException bar) { /* .. snip .. */ } catch (Not...
asked by 25.09.2014 / 18:26
2
answers

Open DIV after clicking a Button with Link

I would like to know how to create, in CSS3, Javascript or Jquery, a button that, upon clicking it, reveals a DIV on it, and that a new page with target _blank is opened. I've done enough research, found some things, but nothing concrete. Of...
asked by 14.11.2014 / 19:22
2
answers

How to get a loose number in my HTML?

Consider the following code: <span class="test"><span style="color:green">Teste</span>:</span> Text<br><br> <span class="test"><span style="color:green">Mais</span>:</span> Text<br...
asked by 22.04.2014 / 00:49
3
answers

How to create a click event that is only called when clicking off of a div?

I need to click on a div (it's a register), it will close. What selector should I use so that by clicking anywhere outside the div this div closes? $(????).on("click", function(){ $('div').hide(); }); If you click on any par...
asked by 07.03.2014 / 22:17
1
answer

How to mix two colors using JavaScript?

There are two fields where the user informs a color in hexadecimal. When you click mix colors , a calculation must be done in JavaScript and this will have to present a painted picture with the mixed color and the result in hexadecimal....
asked by 12.05.2014 / 06:37
1
answer

How to load scripts js dynamically?

I'm developing a web system that needs to load js files dynamically. The reason for this is that there is a necessary logic for selecting which scripts are required, so unnecessary scripts are not loaded. The problem is that I do not know how...
asked by 02.05.2014 / 01:03
1
answer

What is an Array-Like?

A given string is an array-like, and a given number is not. Already their respective objects are array-likes (the objects themselves), right? An object declared, a DOM Object is also an arraylike, correct? Everything is array-like minus boolean...
asked by 10.11.2014 / 23:25
1
answer

Validate decimal numbers in Javascript

What is the simplest and most correct way to validate a decimal number in Javascript? For example, how to implement a IsNumeric function that has the following Test Cases: IsNumeric('-1') true IsNumeric('-1.5') true IsNumeric('...
asked by 05.06.2014 / 04:28
1
answer

Compacting data with Javascript

Is there any way to compress strings using Javascript? I'm developing something for a platform where it is not possible to use any server language (at least on their host) and we do not have access to the database. But I have found a way to s...
asked by 28.12.2014 / 15:00