Foros del Web » Programando para Internet » Javascript »

llamar archivo

Estas en el tema de llamar archivo en el foro de Javascript en Foros del Web. Hola buenas tengo mi script de ajax para las imagenes en movimiento y creo para llamar paginas a dentro de un div el siguiente: @import ...
  #1 (permalink)  
Antiguo 21/11/2010, 05:08
Avatar de VencerNow  
Fecha de Ingreso: noviembre-2010
Ubicación: Mexico D.F.
Mensajes: 27
Antigüedad: 13 años, 5 meses
Puntos: 1
Pregunta llamar archivo

Hola buenas tengo mi script de ajax para las imagenes en movimiento y creo para llamar paginas a dentro de un div el siguiente:
Código Javascript:
Ver original
  1. <script language="javascript">
  2.  
  3.         // FUNCION AJAX PARA LA CARGA DE LAS SECCIONES
  4.  
  5.         function LINK_ajax(http, div_name)  {
  6.  
  7. var LINK_xmlhttp = false;
  8.  
  9.  
  10. try { LINK_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
  11.  
  12.             catch (e) { try { LINK_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
  13.  
  14. catch (e) { try { LINK_xmlhttp = new XMLHttpRequest(); }
  15.  
  16.             catch (e) { LINK_xmlhttp = false; }}}
  17.  
  18.             if (!LINK_xmlhttp) return null;
  19.  
  20.    
  21.  
  22.             //document.getElementById('load_div').style.visibility="visible";
  23.  
  24.  
  25.  
  26.             LINK_xmlhttp.open("GET", http, true);
  27.  
  28.  
  29.  
  30.             LINK_xmlhttp.onreadystatechange = function() {
  31.  
  32.                 if (LINK_xmlhttp.readyState == 4) {
  33.  
  34.                     if (LINK_xmlhttp.responseText.indexOf('ALERT|') > -1) {
  35.  
  36.                         var x = LINK_xmlhttp.responseText.indexOf('ALERT|') + "ALERT|".length;
  37.  
  38.                         var y = LINK_xmlhttp.responseText.indexOf('|ENDALERT') - x;
  39.  
  40.                         window.alert(LINK_xmlhttp.responseText.substr(x , y));
  41.  
  42.                     } else
  43.  
  44.                         document.getElementById(div_name).innerHTML = LINK_xmlhttp.responseText + ' ';
  45.  
  46.                 }
  47.  
  48.             }
  49.  
  50.     LINK_xmlhttp.send(null);  
  51.  
  52.             return false;
  53.  
  54.         }
  55.  
  56. //FUNCION DE PRE-CARGA DE IMAGENES
  57.  
  58.         if (document.images)
  59.  
  60.         {
  61.  
  62.             var fondoDiv = new Image();
  63.  
  64.             fondoDiv = "imagenes/menu/informacion.png";
  65. }
  66.  
  67.  //MUESTRA LA IMAGEN CUANDO SE PASA POR ENCIMA EL BOTON
  68.  
  69.         function entra(boton) {
  70.  
  71.             if (document.images)
  72.  
  73. {
  74.  
  75.                 if (boton == 'btnServ')
  76.  
  77.                     document.images[boton].src = info_on.src;
  78. }
  79.  
  80.         }
  81.  
  82.  //MUESTRA LA IMAGEN ORIGINAL
  83.  
  84.         function sale(boton) {
  85.  
  86.             if (document.images)
  87.  
  88.             {
  89.  
  90.             if (boton == 'info')
  91.  
  92.                     document.images[boton].src = info_off.src;
  93. }
  94.  
  95. }
  96.  
  97. </script>

Bueno pongo el boton asi:
Código HTML:
Ver original
  1. <span title="infrmacion" style="cursor:pointer" onMouseOver="entra('info');" onMouseOut="sale('info');">
  2. <img src="imagenes/menu/info.png" border=0 name='info'>

Bueno hasta alli todo bien, pero tengo un div donde quiero que todo el contenido de los botones salga alli como le ago?
el div esta asi:
Código HTML:
Ver original
  1. <div id="divInfo" style="overflow:auto; width:655; height:500; scrollbar-base-color:#0072bF; scrollbar-face-color:#0072bF; scrollbar-track-color:#0099CC; scrollbar-arrow-color:#0033CC;"></div>

Le puse el ejemplo de un boton, ese boton tengo como 10.
Grax si me pueden contestar y disculpen si soy muy especifico con mis ejemplos.
  #2 (permalink)  
Antiguo 21/11/2010, 15:12
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 9 meses
Puntos: 1532
Respuesta: llamar archivo

disculpa, no entiendo absolutamente nada de lo que pretendes hacer, sorry
__________________
¡Por favor!: usa el highlight para mostrar código
El que busca, encuentra...
  #3 (permalink)  
Antiguo 21/11/2010, 21:30
Avatar de VencerNow  
Fecha de Ingreso: noviembre-2010
Ubicación: Mexico D.F.
Mensajes: 27
Antigüedad: 13 años, 5 meses
Puntos: 1
Respuesta: llamar archivo

Am ver si esta bien el script de ajax para llamar con onclick('pag.html o pag.php','name div')
dentro el div mencionado mediante un <span> O.O por que lo vi del manual y lo copie pero no c si sea funcional, las imágenes no me las carga y no c como hacerlo xD apenas empiezo en el mundo ajax

el script lo copie de esta pag [URL="http://website.lagunarealm.net/"]Solo es ilustrativo xD[/URL]

Etiquetas: llamar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:18.