Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/03/2009, 14:08
Avatar de jeybi
jeybi
 
Fecha de Ingreso: julio-2008
Ubicación: Mexico
Mensajes: 130
Antigüedad: 15 años, 9 meses
Puntos: 10
Respuesta: ayuda llamar a funcion javascript

Prueba asi:

Código javascript:
Ver original
  1. <html>
  2. <head>
  3.  
  4. <script language="JavaScript">
  5.  
  6. function mostrarfotos(rubro){
  7.  
  8. ajax.open("GET","mipagina/fotos.php?argumento="+rubro, true);
  9. ajax.onreadystatechange =function()
  10. {
  11. if(ajax.readyState==4){
  12. var resultado = ajax.responseText;
  13. document.getElementById['productos'].innerHTML = resultado;
  14.  
  15. }
  16. }
  17. ajax.send(null);
  18. }
  19.  
  20. function crearobjetoajax(){
  21. var Obj;
  22. if (typeof XMLHttpRequest == 'undefined' ){
  23. if(navigator.userAgent.indexOf('MSIE 5') >= 0){
  24. Obj= new ActiveXObject('Microsoft.XMLHTTP');
  25. }
  26. else{
  27. Obj=new ActiveXObject('Msxml2.XMLHTTP');
  28. }
  29. }
  30. else{
  31. Obj=new XMLHttpRequest();
  32. }
  33. return Obj;
  34. }
  35. function inicializar()
  36. {
  37. ajax = crearobjetoajax()
  38. }
  39.  
  40. </script>
  41.  
  42. </head>
  43.  
  44. <body onLoad="inicializar()">
  45.  
  46. <div id="productos"></div>
  47.  
  48. <div id="titulo"></div>
  49.  
  50.  
  51. <div id="links">
  52. <ul>
  53. <li><a>Inicio</a></li>
  54. <li><a>Contactenos</a></li>
  55. <li><a onClick="mostrarfotos('rubro1')">rubro1</a></li>
  56. <li><a onClick="mostrarfotos('rubro2')">rubro2</a></li>
  57. </ul>
  58. </div>
  59. </body>
  60. </html>