03/26/08

Using POST and XML in AJAX

In an earlier entry, Missing Data After AJAX Call, I threw a hack together to return multiple values which required parsing based on a separator on the client side.

After testing, I realized using a character as a separator is a bad idea. The data returned could have the character as part of its value and screw up the parsing later on the client side. Storing the data as XML and returning the data as such makes for a more elegant solution.

I also wanted to send a large amount of text through AJAX and the GET request was not getting the job done. Using POST instead of GET works well; the reason behind it is similar to why it works for forms or forum postings.

Talking about the what’s and why’s does not make it very clear. That is why I brought an example with me including the corresponding code. w00t!
Continue reading

02/23/08

Access is Denied. Error Processing Resource.

I was working on a sitemap for a website today and this error popped up when I tried to view the xml file in the browser: Access is Denied. Error Processing Resource.

I am not a big expert on XML and its errors. I was using the same Sitemap generator plugin for WordPress on that site as I do on Frobie.

It turns out the error was pretty simple. The other site did not have the leading “www” part in its URL. The XML file was looking for the XSLT file using the full URL path, but the domains did not match so it threw up the access is denied error.

Example:

With “www”: http://www.frobie.com/sitemap.xml
Without “www”: http://frobie.com/sitemap.xml

Weird.