TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Libraries & Extensions (http://www.talkphp.com/libraries-extensions/)
-   -   Xajax (http://www.talkphp.com/libraries-extensions/2336-xajax.html)

Orc 02-26-2008 12:31 AM

Xajax
 
This nifty PHP Library makes it easier to make AJAX scripts.

Example:
PHP Code:

<?php
include './xajax/xajax_core/xajax.inc.php';

$xajax = new xajax();

$rqstAdd =& $xajax->register(XAJAX_FUNCTION'doAdd');
$rqstReset =& $xajax->register(XAJAX_FUNCTION'doReset');

// set the parameters
$rqstAdd->setParameter(0XAJAX_JS_VALUE39);
$rqstAdd->setParameter(1XAJAX_JS_VALUE571);

$xajax->processRequest();

function 
doAdd($a$b)
{
    
$response = new xajaxResponse();
    
$response->assign('answer''innerHTML'$a $b);
    
$response->assign('reset''style.display''block');
    return 
$response;
}

function 
doReset()
{
    
$response = new xajaxResponse();
    
$response->clear('answer''innerHTML');
    
$response->assign('reset''style.display''none');
    return 
$response;
}


DeMo 02-26-2008 01:10 AM

You forgot the URL: xajax PHP Class Library - The easiest way to develop asynchronous Ajax applications with PHP :-)

I've seen this library before but personally, I prefer doing all AJAX stuff myself. Some time ago I was using AJAX in the admin panel of the system I had designed. In the user management pane you could browse/add/edit/delete users all via AJAX, without reloading the page. Browsing users was the most tricky cause the script downloaded a list of users (id, name, email, level etc) and had to dinamically build the HTML table with that information, I don't know if you can do this kind of thing using a library like XAJAX.

Orc 02-26-2008 01:11 AM

I suck at AJAX. :[ If you could give me a reference, then that would be swell!

reference of all the codes.

Gareth 02-26-2008 03:13 PM

I much prefer jquery or mootools!

abiko 02-26-2008 03:43 PM

Prototype :)
jQuery (or Prototype/mooTools) with JSON :) the way to go.
Just create a little web interface for your AJAX script.
And you're rady to go. I don't belive in php solution that emulates javascript :)

Killswitch 12-14-2008 07:39 AM

I like Xajax. Simple for folk like me who can't write their own Javascript. I've tried JQuery but just can't get my head around it due to all the Javascript needed.

Rendair 12-14-2008 05:31 PM

My JavaScript Framework allows you to use Ajax pretty easy :P

PHP Code:

$.Ajax.form('formid','filetoproccessform','divIdtodisplayresults'); 

And so on. It still needs work, but of course gets the job done for me :P.

Wildhoney 12-14-2008 08:04 PM

javascript Code:
new Ajax.Updater('items', '/items', {
  parameters: { text: $F('text') }
});

I love Prototype!

sketchMedia 12-15-2008 05:25 PM

jQuery for me!
http://docs.jquery.com/Ajax

Borderline 12-29-2008 06:18 AM

started off with sajax, then found xajax and used it alot. now I just use jquery

Orc 09-30-2010 07:49 AM

I don't even remember making this post. Nowadays I just work with jQuery and make plugins for that lol.


All times are GMT. The time now is 05:41 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0