Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jacob Santos' Blog:
XMLHttpRequest Quirks and PHP
Jul 24, 2006 @ 11:46:02

New today on his blog, Jacob Santos has posted some of the quirks that he's found in his dealings with PHP and the XMLHttpRequest object for Ajax comunications.

I didn't find the AJAX frameworks much use while I was working on my current project. I'm sure they are well thought out and designed, but after going through two or three, I was more lost than when I started. I decided then that I should learn how this whole AJAX thing works from the ground up. Turns out XMLHttpRequest isn't all that difficult, once you get past a few JavaScript cross browser hiccups.

He starts off talking about the PHP backend including the three methods you can display the information (return the content) back to the calling script. From there, it's on to the (two) quirks:

  • Don't Create an Instance of the Same Object For multiple Tasks
  • Always Call XMLHttpRequest Object First

Both quirks come with their own code an an explaination as to what the real issue is and how to work around it in your code. All of the changes he mentions, though, are on the client-side, leaving the PHP untouched.

tagged: xmlhttprequest ajax quirks return xml html json xmlhttprequest ajax quirks return xml html json

Link:

Jacob Santos' Blog:
XMLHttpRequest Quirks and PHP
Jul 24, 2006 @ 11:46:02

New today on his blog, Jacob Santos has posted some of the quirks that he's found in his dealings with PHP and the XMLHttpRequest object for Ajax comunications.

I didn't find the AJAX frameworks much use while I was working on my current project. I'm sure they are well thought out and designed, but after going through two or three, I was more lost than when I started. I decided then that I should learn how this whole AJAX thing works from the ground up. Turns out XMLHttpRequest isn't all that difficult, once you get past a few JavaScript cross browser hiccups.

He starts off talking about the PHP backend including the three methods you can display the information (return the content) back to the calling script. From there, it's on to the (two) quirks:

  • Don't Create an Instance of the Same Object For multiple Tasks
  • Always Call XMLHttpRequest Object First

Both quirks come with their own code an an explaination as to what the real issue is and how to work around it in your code. All of the changes he mentions, though, are on the client-side, leaving the PHP untouched.

tagged: xmlhttprequest ajax quirks return xml html json xmlhttprequest ajax quirks return xml html json

Link:


Trending Topics: