Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/05/2014, 12:44
pabliich
 
Fecha de Ingreso: marzo-2010
Mensajes: 28
Antigüedad: 14 años, 10 meses
Puntos: 0
Respuesta: Dos eventos en select box

Cita:
Iniciado por Italico76 Ver Mensaje
Pues que tu evento onload() te funcione o no dependera de lo que estas poniendo dentro.. y esta como innecesario (aunque inofensivo) que hagas <?php echo funcion_en_js(); ?> dentro del onload()

Por que no depuraras tu funcion showIni() ?
Segun estuve averiguando onload() solo funciona en el body. Asi que tenia pensado hacerlo con windows.onload pero no se como pasar los valores de las variables php.
<script language="javascript">
function showIni(str,1,39){
if (str==""){
document.getElementById("cargarproducto"+num).inne rHTML="";
return;
}
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("cargarproducto"+num).inne rHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","catalog/model/catalog/obtendatos.php?q="+str+"&id="+id,true);
xmlhttp.send();
}

window.onload= function()
{
showIni();
}
</script>