Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/12/2012, 22:11
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Cargar iframe de acuerdo a eleccion en un select

Podés evitarte ajax con algo así

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.  
  7. <style type="text/css">
  8. /*<![CDATA[*/
  9.  
  10. html,body{
  11. margin: 0;
  12. padding: 0;
  13. border: none;
  14. height: 100%;
  15. overflow-y: hidden;
  16. }
  17.  
  18. .barra{
  19. width: 100%;
  20. height:auto;
  21. padding: 5px 0;
  22. margin: 0;
  23. background:#202020;
  24. }
  25.  
  26. #destino{
  27. width: 100%;
  28. border: none;
  29. margin: 0;
  30. height: 95%;
  31. }
  32. /*]]>*/
  33.  
  34. <script type="text/javascript">
  35. //<![CDATA[
  36. function cambiar(){
  37. var opcion = document.getElementById('temas').value;
  38. if(opcion != ""){
  39. document.getElementById('destino').src = opcion;
  40. }
  41. }
  42. //]]>
  43. </head>
  44. <div class="barra">
  45. <form action="#">
  46. <select id="temas" onchange="cambiar();">
  47. <option value="">Seleccionar</option>
  48. <option value="http://forosdelweb.com">FDW</option>
  49. <option value="http://www.w3schools.com/tags/att_iframe_marginheight.asp">W3Schools</option>
  50. </form>
  51. </div>
  52. <iframe src="about:blank" id="destino" name="destino"></iframe>
  53. </body>
  54. </html>

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.