2
I need to create a array
in javascript send your information to a page php.
How can I do that?
Next, I had a pg in php that carried a lot of data from the bank.
So to improve her performance, I created a script in javascript which copied the contents of the tables.
But each table has one option
and each option
has a selected
, so I need each option
start as your specific phrase, the same was the whole pg in php. For that I made the script below:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
// frase que desejo localizar
var frase = "minAlarme4_analogico00",
localizado = null;
// loop que percorre cada uma das opções
// e verifica se a frase da opção confere com o
// valor de fase que está sendo procurado
// valor de fase que está sendo procurado
$('#Linha5 option').each(function() {
// se localizar a frase, define o atributo selected
if($(this).attr('value') == frase) {
$(this).prop('selected', true);
}
});
});
</script>
But (minAlarme4_analogico00") is the name of a sensor and I have like 1500. So I need an array to communicate with the php so it takes the names of the sensors.
Do you need it to be something dynamic, like AJAX or do you want to send information from a form using POST or GET and when updating the page update this data? Are you using jQuery or prefer a pure JS response?
– Gabriel Gartz
I don’t get it, I could explain it better?
– noNihongo
Do you know code to handle Arrays in Javascript? http://imasters.com.br/artigo/21197/javascript/entendendo-arrays-nojavascript/
– Tony
Hello Gartz, I need something dynamic. D
– Jessi
I asked this question the other day, maybe this link will help you : http://answall.com/questions/7667/como-enviar-um-array-via-post-para-um-controller-php
– Alessandro Gomes
@user5946, you need to use ajax for this. What is the purpose of this communication, explain the problem better and we can give you a way.
– Marcelo Aymone