Questions tagged as 'javascript'

2
answers

Show content according to Select

How do I, when the user selects the unit, show the content div according to the selected unit? Would it be with jQuery? <div class="form-group"> <label>Selecione a unidade</label><br> <select class="form-co...
asked by 11.06.2018 / 20:30
1
answer

Add javascript variable in CSS class

I need to insert into this following CSS class: .bola { width: 50px; height: 50px; border-radius: 25px; position: absolute; } the variable var corBola = "#"+((1<<24)*Math.random()|0).toString...
asked by 23.08.2018 / 19:36
1
answer

Prevent reloading the page if there is something inside the div

How could I prevent reloading if something existed within a div ? and could it be prevented by making another div appear with the confirmation request instead of the alert of the javascript? I have no idea how I could do this...
asked by 16.06.2018 / 01:13
1
answer

What is the difference between Constructors and Factories in JS?

Studying this question, I think the 2 seem ALMOST the same thing, but while the Factory returns an object when the function is executed (properties and functions do not use this , in this case closures are used) the constructor needs to be...
asked by 15.06.2018 / 03:59
2
answers

Working with Ajax

In the blur event of a field, I give a select in my bank and bring a value and fill in my html. My question is how do I get more than one result or a specific result in the ajax date. The code below works, but it only brings monthly if the cu...
asked by 29.07.2018 / 14:37
1
answer

Help on how to use setItem and getItem of localStorage

I'm trying to save an answer, but I can not, every time I refresh the previous answer back. Here's what I'm trying to implement: <!DOCTYPE html> <html lang="pt-BR"> <head> <meta charset="utf-8"> <...
asked by 01.08.2018 / 17:59
1
answer

When making a ajax request, are there problems if I reload the page immediately?

Hello, I'm developing a system in PHP where it works with lists of IPTV stored in services like pastebin. The user submits a url such as ( link ) in a form and my script will parse row by line of list contents. The problem is that the server tak...
asked by 10.07.2018 / 07:48
1
answer

Callback is executed in the parameter

function requestAjax(url, metodo, data, successCallback) { $.ajax({ url: url, type: metodo, contentType: "application/json; charset=utf-8", data: JSON.stringify(data), statusCode: {...
asked by 10.07.2018 / 01:13
1
answer

Angular with TypeScript or JavaScript?

Searching a little about Angular (v 2+) I saw that in many places it is commented that Angular has TypeScript support and that its use is more common than pure JavaScript, so what are the advantages and disadvantages of using TypeScript or JavaS...
asked by 20.06.2018 / 02:40
3
answers

Add button does not differentiate products

I'm a beginner in HTML and JavaScript and I'm stuck in trouble for a college project. Basically I have an e-commerce without BD, so the products are defined in HTML. My problem is that by clicking the add to cart button, it does not different...
asked by 18.06.2018 / 18:31