To com uma dúvida... Como eu chamo uma função com o nome de determinada variável?
por exemplo:
function teste(){ alert('ok'); }
// Váriavel
funcao = teste;
this.funcao();Valeu
Male
pgnall hasn't added any friends yet.
26/05/2007, 21:42
function teste(){ alert('ok'); }
// Váriavel
funcao = teste;
this.funcao();02/04/2007, 17:02
23/03/2007, 17:12
// CONSULTA BANCO DE DADOS - PROCEDURE
$pe_email = $mysqli->query("CALL sp_valida_email_cadastra ('". $vf->email ."' , '". $vf->nome ."', 1, @retorno)") or die($mysqli->error);
$sql_email = $mysqli->query("SELECT @retorno AS email_existente") or die($mysqli->error);
while($e_obj = $sql_email->fetch_object){
echo $e_obj->email_existente;
}23/03/2007, 15:44
<b>Fatal error</b>: Call to a member function query() on a non-object in <b>D:\carrosenegocios\_php\facilidades.class.php</b> on line <b>35</b><br />
21/02/2007, 15:41
// DEFININDO O AJAX
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
HttpRequest = new XMLHttpRequest();
if (HttpRequest.overrideMimeType) {
HttpRequest.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
HttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
HttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {}
}
}
// CRIANDO CLASSE "cAjax"
var cAjax = new Class.create();
// VARIÁVEIS E ARRAYS DA FILA
fila = [];
ifila = 0;
// DEFININDO FUNÇÕES DE AJAX
cAjax.prototype = {
// INICIALIZANDO CLASSE
initialize: function(){},
// ADICIONAR REQUISIÇÕES DO AJAX NA FILA
Fila: function(funcao, info1, info2, info3){
if(info1 == 'undefined') info1 = 0;
if(info2 == 'undefined') info2 = 0;
if(info3 == 'undefined') info3 = 0;
fila[fila.length]=[funcao, info1, info2, info3];
if((ifila+1)==fila.length) funcao();
},
// QUANDO TERMINAR UMA REQUISIÇÃO AJAX CHAMAR ESTA FUNÇÃO
concluido: function(){
ifila++;
if(ifila+1 == fila.lenght)
fila[ifila][0] ();
},
// CORRIGE OS ERROS TRANSMITIDOS PELO AJAX COMO ACENTUAÇÃO E SINAIS HTML...
corrigir: function(str){
retorno = str.replace(/\+/g," ");
retorno = unescape(retorno);
return retorno;
},
//###################################################
//# COMEÇO DAS FUNÇÕES DE REQUISIÇÕES AJAX #
//###################################################
// FUNÇÃO PARA BUSCAR MODELOS DE ACORDO COM O FABRICANTE ESCOLHIDO
buscar_modelos: function(){
...
}
}
// INICIANDO CLASSE
var ajax = new cAjax();<select name="cbo_id_fabricante_bp" id="cbo_id_fabricante_bp" onchange="ajax.Fila(ajax.buscar_modelos, 'frm_busca_padrao', '_bp', 1);">
Community Forum Software by IP.Board
Licensed to: Webmasters Online

Postagens