Re: Ajax please....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

on 04/07/2006 09:21 PM Ryan A said the following:
> For some reason HTML_AJAX is not working on my local machine (windows based,
> I am getting runtime errors with the examples) and it seems quite

If that is XMLHttpRequest based, that is not surprising. Under IE6,
XMLHttpRequest objects are implemented by ActiveX objects, and for
security reasons Microsoft disabled ActiveX support by default since the
latest service packs.

Bjoern Schotte of ThinkPHP has warned about that in the past:

http://blog.thinkphp.de/archives/43-AJAX-redesign-your-PHP-applications.html

The problem is that XMLHttpRequest is the new new thing that many are
overexcited to use, as if it is the only or the best solution for
performing browser server interaction without page reload.

The truth is that XMLHttpRequest is very problematic and inviable in
many situations, not only due to ActiveX being disabled.

Even IFrame is a much better solution than using XMLHttpRequest for most
purposes people want to use AJAX, as you read below in this post:

http://www.phpclasses.org/blog/post/51-PHPClasses-20-Beta-AJAX-XMLHttpRequest-x-IFrame.html



> Hopefully after reading about my requirment(s) someone can suggest something
> thats really simple (or really well
> documented with examples)
> 
> Requirements:
> Write little or no JS
> When i submit the form, it should simply call my script and print out the
> answer inbetween the DIV tags

You may want to try this forms generation class. It comes with an AJAX
form submit plug-in that does exactly what you want: it generates the
necessary Javascript for you but you do not need to write a single line
of Javascript.

With a few lines of PHP you can instruct the class to generate a
response that can execute different types of actions, like adding or
replacing HTML parts of the page, like you want.


> This is what i want to use it for:
> Client comes to site, wants to make an account, I check if the username he
> entered is not already in use, if already in use I print out a failute
> message in red on the screen if not in use....i make his account and print
> out a success text or redirect him to a success page.

With that class, it is very easy to achieve that. Here you can see an
example of that in action. It is not really a subscription page, but it
is a login page that shows similar browser server interaction:

http://www.phpclasses.org/login.html/v/2

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux