Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Ayuda con Xajax

Estas en el tema de Ayuda con Xajax en el foro de Frameworks JS en Foros del Web. creo que mis direcciones estan bien porq si no me diera error al incluir el primer require pero me sigue diciendo que Error:the xajax Javascript ...
  #1 (permalink)  
Antiguo 18/02/2011, 09:03
Avatar de MaG_MaN  
Fecha de Ingreso: febrero-2011
Mensajes: 6
Antigüedad: 13 años, 2 meses
Puntos: 0
Ayuda con Xajax

creo que mis direcciones estan bien porq si no me diera error al incluir el primer require pero me sigue diciendo que

Error:the xajax Javascript component could not be include.Perhaps the URL is incorrect?

URL:../../../xajax/xajax_js/xajax_core.js


este es el codigo:

Código PHP:
<?php
/*
    File: helloworld.php

    Test / example page demonstrating the basic xajax implementation.
    
    Title: Hello world sample page.
    
    Please see <copyright.inc.php> for a detailed description, copyright
    and license information.
*/

/*
    @package xajax
    @version $Id: helloworld.php 362 2007-05-29 15:32:24Z calltoconstruct $
    @copyright Copyright (c) 2005-2006 by Jared White & J. Max Wilson
    @license http://www.xajaxproject.org/bsd_license.txt BSD License
*/

/*
    Section: Standard xajax startup
    
    - include <xajax.inc.php>
    - instantiate main <xajax> object
*/
require ('../../../xajax/xajax_core/xajax.inc.php');
$xajax = new xajax();

/*
    - enable deubgging if desired
    - set the javascript uri (location of xajax js files)
*/
//$xajax->configure('debug', true);
$xajax->configure('javascript URI''../../../xajax');

/*
    Function: helloWorld
    
    Modify the innerHTML of div1.
*/
function helloWorld($isCaps)
{
    if (
$isCaps)
        
$text 'HELLO WORLD!';
    else
        
$text 'Hello World!';
        
    
$objResponse = new xajaxResponse();
    
$objResponse->assign('div1''innerHTML'$text);
    
    return 
$objResponse;
}

/*
    Function: setColor
    
    Modify the style.color of div1
*/
function setColor($sColor)
{
    
$objResponse = new xajaxResponse();
    
$objResponse->assign('div1''style.color'$sColor);
    
    return 
$objResponse;
}

/*
    Section:  Register functions
    
    - <helloWorld>
    - <setColor>
*/
$reqHelloWorldMixed =& $xajax->registerFunction('helloWorld');
$reqHelloWorldMixed->setParameter(0XAJAX_JS_VALUE0);

$reqHelloWorldAllCaps =& $xajax->registerFunction('helloWorld');
$reqHelloWorldAllCaps->setParameter(0XAJAX_JS_VALUE1);

$reqSetColor =& $xajax->registerFunction('setColor');
$reqSetColor->setParameter(0XAJAX_INPUT_VALUE'colorselect');

/*
    Section: processRequest
    
    This will detect an incoming xajax request, process it and exit.  If this is
    not a xajax request, then it is a request to load the initial contents of the page
    (HTML).
    
    Everything prior to this statement will be executed upon each request (whether it
    is for the initial page load or a xajax request.  Everything after this statement
    will be executed only when the page is first loaded.
*/
$xajax->processRequest();

echo 
'<?xml version="1.0" encoding="UTF-8"?>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>xajax example</title>
<?php
    
// output the xajax javascript. This must be called between the head tags
    
$xajax->printJavascript();
?>
    <script type='text/javascript'>
        /* <![CDATA[ */
        window.onload = function() {
            // call the helloWorld function to populate the div on load
            <?php $reqHelloWorldMixed->printScript(); ?>;
            // call the setColor function on load
            <?php $reqSetColor->printScript(); ?>;
        }
        /* ]]> */
    </script>
</head>
<body style="text-align:center;">
    <div id="div1"> </div>
    <br/>
    
    <button onclick='<?php $reqHelloWorldMixed->printScript(); ?>' >Click Me</button>
    <button onclick='<?php $reqHelloWorldAllCaps->printScript(); ?>' >CLICK ME</button>
    <select id="colorselect" name="colorselect"
        onchange='<?php $reqSetColor->printScript(); ?>;'>
        <option value="black" selected="selected">Black</option>
        <option value="red">Red</option>
        <option value="green">Green</option>
        <option value="blue">Blue</option>
    </select>
</body>
</html>


Alguna idea????
  #2 (permalink)  
Antiguo 18/02/2011, 09:52
Avatar de MaG_MaN  
Fecha de Ingreso: febrero-2011
Mensajes: 6
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: Ayuda con Xajax

Se que soy nuevo... Pero de verdad no c que pueda ser...

Alguna ayuda por favor.
  #3 (permalink)  
Antiguo 18/02/2011, 11:37
Avatar de Patriarka  
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 2 meses
Puntos: 288
Respuesta: Ayuda con Xajax

wue, manda un codigo mas limpio e inclui el xajax en un path facil de encontar
  #4 (permalink)  
Antiguo 19/02/2011, 15:56
 
Fecha de Ingreso: junio-2009
Mensajes: 7
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: Ayuda con Xajax

Ya esta solucionado, cancele la idea de botones y lo reemplace por la idea de radio buttons. En otro momento publico la solucion para que alguien le sirva, ahora continuo trabajando. Gracias a todos!.

Etiquetas: ajax, xajax
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 06:46.