Questions tagged as 'javascript'

1
answer

Validate credit card with js

I would like to know how to validate the credit card through Js. Visa starts with 4 Mastercard starts with 51, 52, 53, 54 or 55; American Express starts with 34 and 37 Does anyone know how to validate this? <fieldset class="fsRe...
asked by 25.10.2015 / 17:28
4
answers

Highlighted if illegible on page

My page (Header of a table and a modal popup), in accented letters or characters of the Portuguese language, are coming illegibly. In the head of the page I have this statement: <head> <title><%=Application("app")%></title...
asked by 24.08.2015 / 20:56
3
answers

Comparing an array element with a string

I need to create a function that gets an array and compare it to a string , outside the array , returning true if, and only if, at least twice the string exists outside the array . The output should look like this: Str2(["a", "b"...
asked by 10.10.2015 / 23:38
2
answers

What are the differences between the find () and eq () selectors?

I'm running some tests to understand what is the difference between simple use of a selector eq() and find() , so that you can select the first row of a table for example. Example 1: $('table tbody tr:first') // ok $('table...
asked by 15.10.2015 / 18:53
2
answers

How to set cursor position in an editable element?

I have the following structure: <pre id="editor" contenteditable="true"> “Always pass on what you have learned.” - Yoda > {|} -- X </pre> I want when someone clicks a button I put the cursor in place of {|} . This...
asked by 25.12.2013 / 00:55
3
answers

Explanation about the function and application of the javascript sort function

I know what the function below is for (return the candidate with the highest number of votes), but I do not understand the function of the function sort , passing another function. Can anyone explain and / or where to find Portuguese ma...
asked by 28.09.2018 / 23:33
4
answers

Function to expand list

I created a "dictionary" from A to Z, where when I want to see what's in the letter A, I click on it. This is beauty. So I do not have to click one by one to find some meaning, I would like to put a function to expand everything from A to Z. I u...
asked by 06.02.2014 / 13:06
1
answer

Back-end applications with node.js

I've seen a few lectures on Node.js , its capacity, usability, market, etc ... But all of this information got really "scrambled" for me, about him. What I know, correct me if I'm wrong, is that it works like server , very similar to A...
asked by 11.01.2016 / 23:11
2
answers

Problems with onmouseclick and onmouseover in JavaScript

I have the following code:  Javascript Test      <script> function mudaLampada(tipo){ if(tipo == 1){ arquivo = "_imagens/lampada-acesa.jpg"; } if(tipo==2){ arquivo= "_imagens/lampada-...
asked by 22.12.2015 / 16:44
2
answers

How to consume this JSON with JavaScript?

How do I consume this URL using JavaScript?    > link     
asked by 15.02.2016 / 16:21