Questions tagged as 'javascript'

3
answers

Switch the image on smaller screens

I have the following code: <div class="container-fluid"> <h1> Áreas de Atuação </h1> <div id="hr-atuacao"> <hr> <div class="card-columns"> <div class="card-img"> <img class...
asked by 07.10.2017 / 18:51
1
answer

Cross-origin request blocked

I'm using an Elsevier API to fetch a book listing. To do this, I'm using an example from them at this link: link I did my registration, got my APIkey and got the following code: <html> <head> <title>Elsevier ScienceDirect S...
asked by 21.11.2014 / 11:58
2
answers

Problem when performing XHR in the same domain (localhost)

Explanation: I have an application running on a client computer, it worked normally for some time, then something happened that the system could only be accessed from outside and locally it did not work anymore . Problem: XHR is not ge...
asked by 10.09.2014 / 19:18
2
answers

How do these sites load your HTML?

I ended up looking at source code from websites like Gmail.com and Secret.ly and I noticed that the HTML is embedded in JavaScript, what technology do they use? It looks like this: <script>var codes = {"AutoControlHeader":true,"CanSub...
asked by 19.11.2014 / 18:53
2
answers

Give alert after entering the word "pass"

How can I perform an alert after the user types "stack". For example, I'm here posting this and after I write stack (without being an input, just writing) it gives an alert. I would have to use keypress and which to check the keys b...
asked by 23.12.2014 / 15:21
2
answers

Implement cascading methods in JavaScript

In the book JavaScript: The Good Parts , Douglas Crockford explains Cascade's concept of cascading method. According to the author these methods are characterized by changing the state of the object without returning anything. Nested methods re...
asked by 06.12.2014 / 18:30
3
answers

I need a function to add br under certain conditions [duplicate]

I want a function that adds the <br> tag when the text has no spacing, I made a Fiddle with the problem: link . This function can be done in JavaScript or PHP. <div class="post"> <p>kkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
asked by 29.10.2015 / 20:00
4
answers

How to return the last record of an array with Javascript or jQuery?

I'm doing a custom search filter where the user can select the brand and the characteristics of the product and I return the id of them. But I wanted to return only the last record of my arrays where they contain all the information I need....
asked by 17.09.2015 / 14:43
5
answers

Count characters while typing [closed]

I'm developing a sales site and it has a product that sells by letter. Ex. Each 10 real letter. If the person wants to name it, add the value: Ex. Betinho (7 letters) R $ 70,00. I need to do this via input text.     
asked by 03.08.2017 / 15:08
3
answers

Why are you concatenating instead of adding?

My code is concatenating instead of adding. what would be my mistake?. var cFinal = 0; var cFabrica = prompt("Insira o valor de fabrica do veículo"); var comissao = 0.28 * cFabrica; var imposto = 0.45 * cFabrica; cFinal = cFabrica + comissao +...
asked by 30.08.2017 / 20:59