Questions tagged as 'javascript'

3
answers

How do I display the API JSON?

After performing this, I came across this error, which did not display API information. Being that in another URL of a similar API the code displayed and worked perfectly. API URL: link $.ajax({ type: "POST", dataType: "JSON", u...
asked by 30.10.2017 / 17:00
2
answers

Conditional javascript call in html5

How can I call a script by following a conditional in html5? For example, depending on the address in the browser it loads certain script If the address is link , load the following script: <script src="js/index.js"></script&g...
asked by 29.10.2017 / 23:14
1
answer

Convert RGB to Hexadecimal with JavaScript

I have to convert rgb value to hex when moving the inputs (range), but when I move nothing happens, the hexadecimal color should appear below as well as the color is changed at the top. The color is only loaded when the page loads, when movin...
asked by 16.03.2018 / 15:46
4
answers

Changing CSS by class in JavaScript, is it possible?

I wonder if it is possible to make changes to the CSS of a class by JavaScript. We were able to get the divs by id with the document.getElementById("nomedaiddadiv"); command. Is there any command that does the same, but with the divs cl...
asked by 14.03.2018 / 18:55
1
answer

What does window.location.reload do?

I have a question about window.location.reload(true) . It with the true parameter, does it actually update the site, downloading all the files again, without using the cache? Or just update the site normally?     
asked by 19.09.2017 / 20:19
2
answers

How do I start jquery results in a div?

My js code is working fine but I wanted it to print the result inside a div in the index.html itself under my textarea and without redirecting to another page, since it is redirecting to the ip.php page and showing the results there. <h...
asked by 07.07.2017 / 18:43
1
answer

'querySelectorAll' does not work

I was doing a test that when clicking the button all 'p' should turn red. Does anyone know what's wrong? function test() { document.querySelectorAll('p').style.color = 'red'; } <!DOCTYPE html> <html> <head> <ti...
asked by 17.07.2017 / 17:27
2
answers

How to format an extended date?

How do I convert a Date to date in full? I would like to show today's date in the following format:    Thursday, July 20, 2017 The example code that you would like to complete to get the above result in a label is exemplifie...
asked by 20.07.2017 / 14:49
3
answers

First and last occurrence of character

In JavaScript, how do you extract from a string anything between the first occurrence of [ and the last occurrence of ] ? Ex: <HR>\n[{"key":"value","key2":["¥"]}]\n<HR>     
asked by 06.07.2017 / 13:23
2
answers

Validating elements of an array in javascript

I have the script below where I am not sure how to prevent an entry whose any part of the name is numeric only. Example Fulano de Tal 123 returns me valid. function formatar() { var nome = document.getElementById("nome").value...
asked by 07.07.2017 / 13:20