Reply to Re: First steps with Ajax

Your name:

Reply:


Posted by Erwin Moller on 09/07/07 13:13

Ron Barnett wrote:
> "Norman Peelman" <npeelman@cfl.rr.com> wrote in message
> news:46df3cfc$0$4036$4c368faf@roadrunner.com...
>> Ron Barnett wrote:
>>> Can anyone advise if I need to set up anything special before I can run
>>> an AJAX application on a PHP enabled Apache server ?
>>>
>>> I have tried demo code and just get no response, its as if the PHP code
>>> isn't getting called.
>>> Normal PHP apps work fine, and regular JavaScript works fine -
>>> mouseovers, submit buttons etc
>>> It is as if there is an extension missing
>>> Any suggestions
>>>
>>>
>>>
>>>
>> You need to check the configuration of your AJAX package. SOme are easier
>> than others... I use XAJAX, very easy to understand.
>>
>> Norm
>
> Ajax package ? could this be the missing link ?

Hi,

You don't need a AJAX packages at all.
I would even suggest you get the thing up and running before diving into
AJAX libs.

A good place to start is www.w3schools.com.
Use their simple browser-independent version to get the xmlhttp object,
and use that for testing.

function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

And make a simple PHP page, like this:
<?php
echo ((int)$_GET["number"])*2;
?>

Call it from browser:
http://www.example.com/test.php?number=4

It should answer 8.

If that works, try implementing the AJAX logic, like described at
www.w3schools.com.

Remember AJAX is nothing more then a way of getting data from a server
into your webpage via javascript. No reload of the page needed.

Regards,
Erwin Moller

> Is XAJAX something that is installed on the server to support the scripts
> (say an extension library in PHP.conf) or is it just part of the scripts
> themselves - like a class library?
>
> Cheers
>
> Ron
>
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация