Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/11/2011, 15:35
Avatar de dcreate
dcreate
 
Fecha de Ingreso: octubre-2009
Ubicación: Veracruz
Mensajes: 536
Antigüedad: 15 años, 1 mes
Puntos: 22
Pregunta como puedo llamar a ejecucion una funcion

hola amigos, disculpen quiero saber como llamar una funcion que ya tengo, pero que se ejecute al iniciar la pagina, el condigo es el siguiente:

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Documento sin t&iacute;tulo</title>
  5. <script language="javascript" type="text/javascript">
  6. <!--
  7. var winheight=100
  8. var winwidth=100
  9. var cat=null
  10.  
  11. step=1;
  12.  
  13. function catswindows(name,width,height,title)
  14. {
  15. if (!document.layers&&!document.all&&!document.getElementById)
  16.  {
  17.   paramstp="height="+height+",width="+width+",top=6"+
  18.   ",left=6,scrollbars=no,location=no"+
  19.   ",directories=no,status=no,menubar=no,toolbar=no,resizable=no"
  20.   cat=window.open("","cat",paramstp);
  21.   oldstr="<html><title>"+title+"</title><body background="+name+"</b"+"ody></h"+"tml>";
  22.   cat.document.write(oldstr);
  23.   if (cat.focus){cat.focus();}
  24.   return;
  25.  }
  26.  
  27. LeftPosition=(screen.width)?(screen.width-width)/2:100;
  28. TopPosition=(screen.height)?(screen.height-height)/2:100;
  29.  
  30. if (document.layers)
  31.  {paramstp="height="+height+",width="+width+",top="+TopPosition+
  32.   ",left="+LeftPosition+",scrollbars=no,location=no"+
  33.   ",directories=no,status=no,menubar=no,toolbar=no,resizable=no"}
  34. else
  35.  {paramstp="height="+winheight+",width="+winwidth+",top="+TopPosition+
  36.  ",left="+LeftPosition+",scrollbars=no,location=no"+
  37.  ",directories=no,status=no,menubar=no,toolbar=no,resizable=no"}
  38.  
  39. cat=window.open("","cat",paramstp);
  40.  
  41. if (document.all)
  42.  {
  43.   string="<html><title>"+title+"</title><body topmargin=0 leftmargin=0 bgcolor=black>";
  44.   string1="<div id=loadintxt style='position:absolute;width:100%;top:45%;text-align:center;visibility:visible;font-family:Comic Sans MS;font-size:16px;font-weight:bold'>Cargando...</div>";
  45.   string2="<div id=errtxt style='position:absolute;width:100%;top:45%;text-align:center;font-family:Comic Sans MS;font-size:16px;color:red;font-weight:bold;visibility:hidden'>Abriendo la página</div>";
  46.   string3='<s'+'cript>'+'var animColorIndex=0;colorArray=["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000","#333333","#666666","#999999","#CCCCCC"];';
  47.   string4='function textLooping(){if(animColorIndex==10)animColorIndex=0;'+
  48.   'loadintxt.style.color=colorArray[animColorIndex];animColorIndex++;}animInterval=setInterval("textLooping()",200);';
  49.   string5="function erroccur(){clearInterval(animInterval);loadintxt.style.visibility='hidden';errtxt.style.visibility='visible';}";
  50.   string6="</s"+"cript>";
  51.   string7='<s'+'cript language="jav'+'ascript1.2">';
  52.   string8='function init(){clearInterval(animInterval);'+
  53.   "loadintxt.style.visibility='hidden';"+
  54.   'fltr.filters.item(0).Apply();fltr.filters.item(0).Play();'+
  55.   'fltr.style.visibility="visible";}'+'</s'+'cript>';
  56.   string9='<img id="fltr" style="filter:BlendTrans(Duration=5);visibility:hidden" src="'+name+'" border=0'+
  57.   ' width='+width+' height='+height+' onload="init()" onerror="erroccur()">'+
  58.   '</b'+'ody></h'+'tml>';
  59.  }
  60.  
  61. if (document.layers)
  62.  {
  63.   toppos=height/2-40;
  64.   leftpos=width/2-40;
  65.   string="<html><title>"+title+"</title><body bgcolor='#000000'><div id=loadintxt style='position:absolute;top:"+toppos+"px;left:"+leftpos+"px;'></div>"
  66.   string1='<s'+'cript>var animColorIndex=0;colorArray=["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000","#333333","#666666","#999999","#CCCCCC"];'
  67.   string2='function textLooping(){if(animColorIndex==10)animColorIndex=0;document.loadintxt.document.open();'
  68.   string3='document.loadintxt.document.write("<center><font size=4 face=Comic Sans MS color="+colorArray[animColorIndex]+"><b>Loading...</b></font></center>");document.loadintxt.document.close();'
  69.   string4='animColorIndex++;};animInterval=setInterval("textLooping()",200);</s'+'cript>'
  70.   string5='<s'+'cript language="jav'+'ascript1.2">'
  71.   string6="function init(){document.catpic.visibility='show';clearInterval(animInterval);document.loadintxt.visibility='hide';};"
  72.   string7="function erroccur(){errstr='ERROR!!! Please try again';alert(errstr);}</s"+"cript>"
  73.   string8="<div id=catpic style='position:absolute;left:0px;top:0px;visibility:hidden'>"
  74.   string9="<img src='"+name+"' width="+width+" height="+height+" border=0 onload='init()' onerror='erroccur()'></div></b"+"ody></h"+"tml>";
  75.  }
  76.  
  77. if (document.getElementById&&!document.all)
  78.  {
  79.   toppos=height/2-40;
  80.   leftpos=width/2-40;
  81.   string="<html><title>"+title+"</title><body bgcolor='#000000'><div id=loadintxt style='position:absolute;top:"+toppos+"px;left:"+leftpos+"px;'></div>"
  82.   string1='<s'+'cript>var animColorIndex=0;colorArray=["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000","#333333","#666666","#999999","#CCCCCC"];';
  83.   string2='function textLooping(){if(animColorIndex==10)animColorIndex=0;ls="<font size=4 face=Comic Sans MS color="+colorArray[animColorIndex]+"><b>Loading...</b></font>"';
  84.   string3='document.getElementById("loadintxt").innerHTML=ls;'
  85.   string4='animColorIndex++;};animInterval=setInterval("textLooping()",200);</s'+'cript>'
  86.   string5='<s'+'cript language="jav'+'ascript1.2">'
  87.   string6='function init(){document.getElementById("catpic").style.visibility="visible";clearInterval(animInterval);document.getElementById("loadintxt").style.visibility="hide";}';
  88.   string7="function erroccur(){errstr='&iexcl;&iexcl;&iexcl;ERROR!!! Por favor, prueba de nuevo.';alert(errstr);}</s"+"cript>"
  89.   string8="<div id=catpic style='position:absolute;left:0px;top:0px;visibility:hidden'>";
  90.   string9="<img src='"+name+"' width="+width+" height="+height+" border=0 onload='init()' onerror='erroccur()'></div></b"+"ody></h"+"tml>";
  91.  
  92.   x=y=step;
  93.   while (x | y)
  94.    {
  95.     cat.resizeBy (x, y);
  96.     if (cat.window.innerWidth >= width) x=0;
  97.     if (cat.window.innerHeight >= height) y=0;
  98.    }
  99.  }
  100.  
  101. cat.document.writeln(string);
  102. cat.document.writeln(string1);
  103. cat.document.writeln(string2);
  104. cat.document.writeln(string3);
  105. cat.document.writeln(string4);
  106. cat.document.writeln(string5);
  107. cat.document.writeln(string6);
  108. cat.document.writeln(string7);
  109. cat.document.writeln(string8);
  110. cat.document.writeln(string9);
  111.  
  112. if (document.all)
  113.  {
  114.   x=y=step;
  115.   while (x | y)
  116.   {
  117.    cat.resizeBy (x, y);
  118.      if (cat.document.body.clientWidth >= width) x=0;
  119.      if (cat.document.body.clientHeight >= height) y=0;
  120.   }
  121.  }
  122.  
  123. if(cat.focus){cat.focus();}
  124. return;
  125. }
  126.  
  127. function CloseCatWin()
  128. {if(cat!=null && cat.open)cat.close()}
  129.  
  130. window.onfocus=CloseCatWin;
  131.  
  132. //-->
  133. </head>
  134.  
  135. <body bgcolor="#762BA8">
  136. <input TYPE="button" VALUE="Ver" ONCLICK="catswindows('teleton.jpg','450','355','Pantalla emergente'); return false" onfocus="this.blur()"></p>
  137. </body>
  138. </html>

este codigo abre una pantalla que se empieza a expander, pero quiero quitarle el boton para abrir dicha ventana, ya puse algo como

Código HTML:
Ver original
  1. <body onload="catswindows('teleton.jpg','450','355','Pantalla emergente')">

pero nada
__________________
Somos lo que pensamos, como pensamos vivimos.