Questions tagged as 'javascript'

2
answers

How to return 2 decimals in a monetary value with jQuery?

How can I handle this string so that it returns only 2 decimals after the point? $(".subtotal2").text(23.90); var sum = 0; $(".subtotal2").each(function() { var val = $.trim( $(this).text() ); if (val) { val = parseFlo...
asked by 15.10.2014 / 06:10
2
answers

Receive id of an autocomplete option

I have the following autocomplete defined in HTML HTML <label class="input"> <input type="text" list="list" id="entidade" placeholder="Cliente" onblur="dadosCliente ( )"> <datalist id="list"> @for(entidade...
asked by 06.02.2015 / 12:26
2
answers

Check which page was previously accessed and if it shows something

I need to make a verification that if the source is not coming from facebook.com you will not be able to show a certain code. Only people coming from facebook.com will be able to see the particular code, if it comes from another link,...
asked by 06.02.2015 / 19:48
2
answers

Artist cover update generates many requests

I have the following code snippet: var musica_atual = ''; var capasplit = ''; function checaURL(endereco){ var http = new XMLHttpRequest(); http.open('HEAD', endereco, false); http.send(); return http.status != 404; }...
asked by 04.02.2015 / 04:36
3
answers

Add DIV's with different ID's using Jquery

Hello, I tried several gambiarras (unfortunately) but I can not find a solution to my idea. I have an "app" that creates a task list, only I would like to add to my list a different id for each div added inside the div main%. var ma...
asked by 09.04.2015 / 14:42
2
answers

Loop in javascript does not add object property

follow my code var canvasEvents = new Object; canvasEvents['05-30-2015'] = '<a href="#" target=_blank>CAMPEONATOS SUL-AMERICANOS DE ATLETISMO</a>'; $.getJSON('http://www.atletismope.com.br/eventos/lista', function(...
asked by 15.04.2015 / 16:25
2
answers

List validation with jQuery [closed]

I'm solving some exercises in javascript and I came across a situation I can not solve. I have a small "application" that creates a task list, so far it works normally, I can add a new div inside the main div. however, I need to check if the...
asked by 09.04.2015 / 14:33
1
answer

Get max and min array

I wanted to get a maximum and minimum of an Array. The Array comes in PHP and I use Json to convert to JavaScript. I used Math.max.apply(null, js_array) _function but it does not work for me. //convert php array to javascript var js_array = [&...
asked by 26.12.2014 / 17:54
1
answer

Transition does not work in class exchange with JavaScript?

I have a dropdown menu made by me that acts with very simple class switching ( block or none ). The script works and updates the classes in the correct way, but it apparently ignores the transition property of the class an...
asked by 16.12.2014 / 07:59
1
answer

How to prevent browser from displaying alert and resending previous information?

Work in a .aspx WEB application that writes data to the database. The problem is that after writing this data and displaying a success information for the user, if I do a reload on the page the browser will send the information back to the serve...
asked by 16.12.2014 / 18:08