Questions tagged as 'javascript'

2
answers

I have difficulty understanding the logic

Problem:    Create a fonts () function that takes a phrase as input. Then write in the body of the page this   using different font sizes (from 1 to 7). For this, you must make a loop that will repeat the following TAG,   changing only the "s...
asked by 30.05.2014 / 14:51
2
answers

Help in javascript and asp.net mvc

In my project I have a field that is the Status of a given occurrence. That is, whether it is pending or resolved. I made a function in javascript that, when clicking the input field that is in readonly mode, changes the background. I mean, if t...
asked by 02.06.2014 / 20:16
1
answer

How to execute a javascript function in closing the browser?

I'm developing a web application and need to perform a function when the client clicks the browser's X or simply closes it. To be more specific, I need to execute an ajax call on this closing. Is there any way to do this?     
asked by 26.06.2014 / 22:29
2
answers

XMLHttpRequest connection return

I have the following code: function httpGet(theUrl) { var xmlHttp = null; xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", theUrl, false ); xmlHttp.send( null ); return xmlHttp.responseText; } httpGet("www.xxxx.com.br/...
asked by 12.06.2014 / 16:27
3
answers

Insert an empty line tr at each size range of an html table (with Javascript)

I have an HTML page that works as a report page. It has a table that is fed by the database, however when there are many rows in the query then the HTML table gets too large. It turns out that because of this, if I try to print the page, the...
asked by 14.08.2014 / 18:04
2
answers

How to put links in words automatically with javascript?

If the page contains the words "contact", "help" and others .. turn them into a link: <a href='http://meusite.com/pagina1.html'>contato</a> <a href='http://meusite.com/pagina2.html'>ajuda</a> Example: You may n...
asked by 22.07.2018 / 03:41
1
answer

Array deformation

I'm lost, where is the code logic? const contatos = [ { nome: 'Alex Júnior', numero: '1234-5678' }, { nome: 'Carolina Moya', numero: '1234-6789' }, { nome: 'Fernando Jor...
asked by 13.06.2018 / 17:55
4
answers

How to center a rectangular image in a square div

When I try to place a rectangular image inside a square div, the image is trimmed evenly, as it cuts only one side. When I mean to center the image I mean distribute the image equally to both sides and cut equal pieces of the image to form the s...
asked by 02.08.2014 / 20:57
2
answers

div that works like a textarea does not break line when it is sent

I have a comment plugin for WordPress which has a small problem. It works like this: It is a <div> that works as if it were a <textarea> , only because it works like this, when the user wants to type a comme...
asked by 07.07.2014 / 22:42
2
answers

Error in ordering positive and negative numbers Jasvascript

I have an array with multiple numbers, these numbers are positive, negative and with decimal too: var array = [365, -1.304, -17.803, -3.529, -3.602, -2.942, -2.074, -115] I need to sort this array from MINOR to the LARGEST . The result y...
asked by 21.11.2016 / 19:22