TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-26-2008, 12:31 AM   #1 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default 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;
}
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 02-26-2008, 01:10 AM   #2 (permalink)
The Contributor
 
DeMo's Avatar
 
Join Date: Jan 2008
Location: Brazil
Posts: 77
Thanks: 14
DeMo is on a distinguished road
Default

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.
Send a message via ICQ to DeMo Send a message via MSN to DeMo Send a message via Skype™ to DeMo
DeMo is offline  
Reply With Quote
Old 02-26-2008, 01:11 AM   #3 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

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

reference of all the codes.
__________________
VillageIdiot can have my babbies ;d

Last edited by Orc : 02-26-2008 at 03:45 PM.
Orc is offline  
Reply With Quote
Old 02-26-2008, 03:13 PM   #4 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

I much prefer jquery or mootools!
Gareth is offline  
Reply With Quote
Old 02-26-2008, 03:43 PM   #5 (permalink)
The Contributor
 
abiko's Avatar
 
Join Date: Feb 2008
Location: Croatia
Posts: 90
Thanks: 4
abiko is on a distinguished road
Default

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 :)
__________________
Back from sysadmins to the programmers.
Send a message via ICQ to abiko Send a message via MSN to abiko
abiko is offline  
Reply With Quote
Old 12-14-2008, 07:39 AM   #6 (permalink)
The Contributor
 
Join Date: Feb 2007
Posts: 64
Thanks: 9
Killswitch is on a distinguished road
Default

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.
Killswitch is offline  
Reply With Quote
Old 12-14-2008, 05:31 PM   #7 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

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.
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
Old 12-14-2008, 08:04 PM   #8 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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

I love Prototype!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 12-15-2008, 05:25 PM   #9 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

jQuery for me!
http://docs.jquery.com/Ajax
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 12-29-2008, 06:18 AM   #10 (permalink)
The Wanderer
Newcomer Newcomer 
 
Join Date: Nov 2005
Location: Kansas
Posts: 7
Thanks: 0
Borderline is on a distinguished road
Default

started off with sajax, then found xajax and used it alot. now I just use jquery
__________________
Slack5
Borderline is offline  
Reply With Quote
Old 09-30-2010, 07:49 AM   #11 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

I don't even remember making this post. Nowadays I just work with jQuery and make plugins for that lol.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 03:08 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design