Re: Re: PHP, SQL, AJAX, JS and populating a SelectBox?

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

 



Manuel Amador (Rudd-O) wrote:
> Greg Beaver wrote:
> 
>> This is far too complicated.  You don't need 50 lines of code to convert
>> from server-side data to HTML when the browser does it for you (and far
>> more efficiently) with this code:
>>
>> var someCallback = {
>>    ajaxfunc: function(res) {
>>       document.getElementById('blah').innerHTML = res;
>>    }
>> }
>>  
>>
> You know you're oversimplifying matters.  What if the returned markup is
> invalid?  What if the server experienced an HTTP 500 error?  Why should
> anyone want to program their application to return 'tag soup' instead of
> formally defining interfaces via standards?  That's asking for
> maintenance nightmares.

1) what if the returned markup is invalid?

Well, the browser renders it oddly, and through the fact that your
server-side code is straightforward filling in an html template with
actual values, all you need to do is view the source (with the firefox
web debugging extension you can view generated source) or to add an
"alert(res)" in there.

2) HTTP 500?

This should be handled internally by the ajax mechanism (HTML_AJAX does
handle this)

3) tag soup?

I hardly think a <select> tag qualifies as "tag soup" but "tag soup" is
of course a non-definite term anyways :).

Greg

-- 
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