Questions tagged as 'javascript'

2
answers

How to make a selection with javascript

How to select test8 from the post that I clicked? var black = document.querySelectorAll(".test4"); for(var i = 0; i < black.length; i++){ black[i].addEventListener("click", selectRoxo); } function selectRoxo(){ // Como sele...
asked by 21.03.2018 / 21:51
1
answer

Return only the one containing the search in the tree

Good morning, I have a tree that has several subjects and subassuntos and in the tip I have the requirements. When you perform a search in the tree, it opens whole and shows what the search contains. However, I would like it to return only the o...
asked by 22.03.2018 / 15:25
1
answer

Global State using reactjs

I'm starting in the reactjs and I need to do a global state to hide / show a div but the click that hides this in another file that contains another state, how do I make it global?     
asked by 22.03.2018 / 15:10
1
answer

how to block an action in a form

I have a form and it executes an action , however I have a query to check if there are users in the database. I would like to know how I block the action when there are users. Form: <form onsubmit="return asd()" id="gform" method=...
asked by 19.03.2018 / 13:17
2
answers

Create expressions in strings [closed]

Suppose I have the following string: const str = 'Eu sou @if (1 + 1 === 2): um dois @endif !'; How do I run expressions like that if ? I do not want a solution to that problem, just the right way to do it.     
asked by 19.03.2018 / 19:36
1
answer

Getting JSON user data by jquery

I have a json that I'm running through json-server and it's at: link Within it, it has a scope of "users", which I would like to take. I have the following script I put together, it follows: $.getJSON(urlParam, function (data) {...
asked by 11.05.2018 / 19:38
1
answer

Generalize a Javascript dropdown function?

Hello, I'm having a hard time generalizing a dropdown function, I guess I'm doing something wrong, I searched on forums and did not find the answer so I'll open that topic. My HTML code is like this, there are several buttons with the same...
asked by 12.05.2018 / 00:04
1
answer

doubts about target="_ blank"

When I use target="_ blank" it opens a new tab and focuses on it I just want it to open a new tab but focus continues to the current page.     
asked by 12.05.2018 / 14:40
1
answer

Scope of service-worker?

I'm working on a PWA and would like to know if the scope or directory where the service-worker file is located might interfere with, for example, push notifications. Does a file within /statics/sw.js work in the same way as one that is...
asked by 17.04.2018 / 15:50
2
answers

How to remove divs from a list of images with jQuery?

I created divs using: $('.images').find('img').replaceWith(function () { return '<div class="resize">' + this.outerHTML + '</div>' }); Output HTML: <div class="images"> <div class="resize"><img src="...
asked by 17.04.2018 / 16:46