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
There have been 187 items by pgnall (Search limited from 14/05/2023)
Posted by pgnall on 26/05/2007, 21:42 in Javascript / DOM / AJAX / ECMAScript
function teste(){ alert('ok'); } // Váriavel funcao = teste; this.funcao();
Posted by pgnall on 02/04/2007, 17:02 in HTML, CSS e Metodologias
Posted by pgnall on 23/03/2007, 17:12 in PHP
// 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; }
Posted by pgnall on 23/03/2007, 16:22 in PHP
// INICIANDO SESSÃO session_start(); // INCLUINDO ARQUIVOS NECESSÁRIOS require_once("./_php/facilidades.class.php"); require_once("./_php/configuracoes.inc.php"); // INICIANDO CLASSE DE FACILIDADES $facil = new Facilidades;
// CONEXÃO - MySQL $mysqli = new mysqli("localhost","root","1234","eduardo");
class Facilidades { public function fabricantes($selecionado = "0"){ // SELECIONANDO OS FABRICANTES NO BANCO DE DADOS $sql_fabricantes = $mysqli->query("SELECT * FROM carros_fabricantes ORDER By txt_nome_fabricante ASC") or die($mysqli->error); // VARIÁVEL AONDE TERÁ O VALOR DAS OPÇÕES $cbos_fabricantes; // RETORNANDO RESULTADOS E CRIANDO OS CAMPOS while($rf = $sql_fabricantes->fetch_object){ $cbos_fabricantes .= "<option value=\"". $rf-> id_fabricante ."\""; if($selecionado == $rf-> id_fabricante) $cbos_fabricantes .= " selected=\"selected\""; $cbos_fabricantes .= ">". $rf-> txt_nome_fabricante ."</option>"; } // RETORNA O HTML DAS OPÇÕES return $cbos_fabricantes; } }
Posted by pgnall on 23/03/2007, 15:44 in PHP
<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 />
Posted by pgnall on 21/02/2007, 15:41 in HTML, CSS e Metodologias
// 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);">
Posted by pgnall on 28/01/2007, 16:46 in PHP
Warning: session_start() [function.session-start]: open(C:\PHP\sessiondata\sess_2b0e5492cdced42317c41ecf5dcac683, O_RDWR) failed: No such file or directory (2) in D:\carrosenegocios\index.php on line 3 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\carrosenegocios\index.php:3) in D:\carrosenegocios\index.php on line 3 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\carrosenegocios\index.php:3) in D:\carrosenegocios\index.php on line 3
Posted by pgnall on 28/12/2006, 21:43 in Teoria de Programação
Posted by pgnall on 28/12/2006, 21:22 in Dúvidas Gerais
Posted by pgnall on 26/12/2006, 14:06 in Dúvidas Gerais
Posted by pgnall on 25/12/2006, 18:31 in PHP
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in S:\Site2\_php\imagem.class.php on line 178
function existe($idImagem, $abcImagem="a", $prefixo="t"){ if( file_exists( $IMG_DIR . $prefixo"_". $idImagem ."_". $abcImagem .".jpg" ) ) return true; else return false; }
$ROOT_DIR = "S:/Site2/"; $IMG_DIR = $ROOT_DIR."veiculos/";
Posted by pgnall on 25/12/2006, 11:54 in HTML, CSS e Metodologias
Posted by pgnall on 23/12/2006, 11:56 in HTML, CSS e Metodologias
function er(str){ ER = /[^erro=]+[a-z]+[_]+[a-z]+/i; vlFinal = ER.exec(str); if(vlFinal == "undefined") return false; else return vlFinal; } document.write( er('erro=EMPTY') ); //document.write( er('erro=NOT_INTERGER') );
Community Forum Software by IP.Board
Licensed to: Webmasters Online