Questions tagged as 'javascript'

2
answers

How to create an element with child without adding it?

Imagine: var pai = document.createElement('div'); var filho = document.createElement('div'); I want the child to be inside the parent before adding it to the document. It is impossible with parent.appendChild (child) because parent is i...
asked by 28.02.2018 / 23:27
1
answer

Replace value after tag, but within div

I have the HTML code, and I need to do the decimal substitution at the end of the div, the project is doing a reverse proxy for a site, and I have to put the value of the "changed" tag in the place where the "11.00 " the HTML is this: <div...
asked by 01.03.2018 / 15:37
1
answer

Promise Javascript

I have a scenario in which I make various Ajax calls to a WebApi and with the return I load controls from an application. I would like to create a single method to call the API, which would receive a parameter with the link, for example 'api...
asked by 28.02.2018 / 19:42
1
answer

Go to the "home" page [duplicate]

How can I do this through a javascript function, which activates the "Home" command, ie the page jumps to the top of it? Example: A button that is clicked at the bottom of the page redirects overflow to the top.     
asked by 01.03.2018 / 16:43
2
answers

How to put a java script inside the value html

I have a variable of any kind: let variavel = x; and I have the input: <input type="text" value=""> Is there a way in javascript pure to pick up a variable or any javascript code and put inside html tags? In this example it wo...
asked by 01.03.2018 / 22:19
3
answers

How to add HTML with onClick event in React

It may seem like a repeated question, but the examples I found are complicated and need a pre-defined array, I do not have that, I'd like to know the simplest way to add an element to the DOM with React, it's like jQuery and I should change the...
asked by 01.03.2018 / 21:23
1
answer

How to select a specific HTML tag when there is no id or name and (rarely has a class) using jQuery?

I have the following HTML code: <div class=""> <table> <tbody> <tr>TITULO DO BOX</tr> </tbody> </table> <table class="classeTable"> <tbody>...
asked by 02.03.2018 / 14:02
1
answer

Sending JWT without Framework

What is the best way, in terms of good practices and practicality, to simplify the process of trafficking a JWT? I know that with Ionic or Angular, after configuring some module for JWT, the application starts to inject the token in all reque...
asked by 01.03.2018 / 21:44
1
answer

Execute three functions in the same setInterval

How can I perform three functions within the same setInterval, and for one the time to update should be different. I've tried the following: function sleep(ms) { return new Promise(resolve => setInterval(resolve, ms)); } async function...
asked by 02.03.2018 / 13:43
1
answer

Include angular sass 5

What better way to set SASS in angle 5, and there is some specific implementation to organize it into the project.     
asked by 02.03.2018 / 01:22