[Javascript] Changing an Objects ID and Name
Scott Reynen
scott at randomchaos.com
Wed Sep 6 17:42:12 CDT 2006
On Sep 6, 2006, at 5:10 PM, tedd wrote:
> At 9:05 AM -0700 9/6/06, Brian L. Matthews wrote:
>>> 1. With ajax you can change the html between divs.
>>
>> No. Ajax is the client communicating with a server, usually using
>> XMLHttpRequest. While lots of applications manipulate the DOM in
>> the client based upon the result of the request, the two are
>> completely independent. A page can make XMLHttpRequests and then
>> not change the page in any way, and JavaScript (or other client
>> side scripting languages) can modify the page using DOM methods
>> without talking to a server at all.
>
> Well maybe I just don't know any better.
>
> I used ajax to send a XMLHttpRequest that changes the html without
> reloading the entire page.
No, you didn't. You used AJAX/XMLHttpRequest to fetch content from
the server. You used DOM manipulation to change HTML. That you used
both in the same script does not in any way contradict what Brian
said: the two are completely independent. AJAX is not the same as
DOM manipulation.
On Sep 6, 2006, at 5:22 PM, tedd wrote:
> Again, what is it that I'm not getting here? Is it communication
> with the server? Must the solution not contact the server, is that it?
Why would you use AJAX here? It doesn't appear to solve the problem
at hand. If you're just using AJAX because you want to use AJAX,
that's fine, but presenting it as a solution to a problem it doesn't
actually solve is likely to confuse people. The problem of swapping
images is solved with DOM manipulation. Anything you add on top of
that is solving a different problem -- assuming it solves a problem
at all.
Peace,
Scott
More information about the Javascript
mailing list