Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/03/2012, 20:51
Avatar de Ex_shadow
Ex_shadow
 
Fecha de Ingreso: febrero-2012
Ubicación: Calera Avellaneda, Buenos Aires, Argentina, Argentina
Mensajes: 95
Antigüedad: 12 años, 2 meses
Puntos: 4
Sonrisa Respuesta: Objeto literal , javascript

Cita:
Iniciado por IsaBelM Ver Mensaje
has de hacer que se ejecute. de lo contrario será tomado como un "string"
No hay caso :S


Index.php
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.     <head>
  3.         <!-- Funciones -->
  4.         <script language="javascript" type="application/javascript" src="Funciones.js"></script>
  5.         <!-- Caracteres -->
  6.         <meta http-equiv="content-type" content="text/html" charset="utf-8" />
  7.         <!-- Titulo -->
  8.         <title>SlideShow</title>
  9.     </head>
  10.  
  11. <script type="application/javascript" language="javascript">
  12. var Get_Ajax = {
  13.     Procesado : function(){ alert('Procesado'); },
  14.     Pagina : 'Procesado.php',
  15.     Asincronia : 600,
  16.     Parametros : function() {return document.getElementById('Input').value}
  17.  
  18. }
  19. <input type="text" id="Input" />
  20. <input type="submit" onClick="Ajax();" />
  21.  
  22.     </body>
  23. </html>

Javascript.js
Código Javascript:
Ver original
  1. function Ajax(){
  2.    
  3.     /* --- Variable ajax --- */
  4.     var ajax;
  5.    
  6.     if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  7.             ajax = new XMLHttpRequest();
  8.     }else{
  9.             ajax = new ActiveXObject("Microsoft.XMLHTTP");
  10.     }
  11.    
  12.     /* --- Estados --- */
  13.     ajax.onreadystatechange = function (){
  14.         /* --- Si todo es correcto --- */  
  15.         if(ajax.readyState==4 && ajax.status==200){
  16.             Get_Ajax.Procesado;
  17.         }
  18.     }
  19.    
  20.     /* --- Usando el metodo open --- */
  21.     ajax.open("GET",Get_Ajax.Pagina+'?'+Get_Ajax.Parametros,Get_Ajax.Asincronia);
  22.     ajax.send(null);
  23. }

El error :

file:///C:/Users/user/Documents/Objetos%20Javascript/Procesado.php?function%20()%20{return%20document.getElementById( 'Input').value

La Funcion me la toma como un string