Questions tagged as 'javascript'

3
answers

How to remove string-specific word?

I have an input where the user can insert his own site, and I insert http: // when writing to db, but I would like to treat it so that if there is already this tag in the input it does not insert again, since the user updates he re-inserted the...
asked by 09.06.2017 / 14:44
5
answers

Remove all elements from an array that already exist in another

I have two arrays with objects in javascript: var a = [{objeto1}, {objeto2}, {objeto3}, {objeto4}, {objeto5}]; var b = [{objeto1}, {objeto2}]; How can I do what is in the array b exit the array a ?     
asked by 18.05.2017 / 19:56
3
answers

Partial selection of a class with jQuery

Hello, I would like to know if you can select a class / element from a partially informed value, for example: <div class="chart-piso c100 p100 orange big"> <span id="percPiso">100%</span> <div class="slice">...
asked by 26.01.2017 / 12:55
2
answers

What is the Cifrao ($) before a Function in JavaScript?

Variants and functions, for example: $(function() {})     
asked by 24.07.2017 / 18:59
4
answers

How to choose a convention for names of variables and functions?

I'm going through the second development company and in both it does not have an own convention to use in the declarations, in the codes I get functions declared as follows:    PHP and jQuery    function nome_pessoa(); function nomePessoa...
asked by 06.10.2017 / 17:18
2
answers

How to traverse an array by skipping some indices?

Is there a native way of doing this? for (var i in vetor) { for (var j in vetor) { if (i == j) { // pula o i break; } } } Is there any way to skip i within the parentheses of the second...
asked by 08.09.2017 / 16:26
2
answers

How do I play a song when the user puts the mouse over an element?

Is it possible that when the user hover over a certain element on the site, a song would play? If so, how?     
asked by 07.10.2017 / 23:41
3
answers

Execute functions without the Jquery click event

How do I run a particular function without having to wait for the user to click the button? For example, if input username is empty, add div and when it is not empty the div is destroyed, without any button, without cli...
asked by 19.07.2015 / 18:41
2
answers

How do I put a property name in a JavaScript Object?

js = { p1: { qq: "qq_val", }, p2: [{ qq: "qq_val", }] }; json = JSON.stringify(js); console.log(json); // {"p1":{"qq":"qq_val"},"p2":[{"qq":"qq_val"}]} Well, I just want...
asked by 12.09.2015 / 17:56
2
answers

how to use $ (this) + checked?

<input type="radio" name="teste1" value="SIM"> TESTE 1 <input type="radio" name="teste1" value="NÃO"> TESTE 2 $(document).ready(function(){ $("[name='teste1']").click(function () { var teste = $(this+":checked").val();...
asked by 28.10.2015 / 16:00