Site icon The Winter Blog

POST using xmlhttprequest

Struggled with this all of yesterday and earlier today. Finally, discovered what seems to be a bug in the implementation (or something that specs missed):

When passing arguments / parameters with a POST request, the javascript: xmlHttpRequest function seems to truncate/modify the first and last arguments.

So, now I’m sandwiching the actual arguments between empty buffer parameters and its working.

Can’t believe how many hours I’ve wasted on this one issue, and that no one addresses it anywhere on the web.

Anyway, the whole app is now working via ajax, and, as a result, is lightening fast. Now, need to include offline storage of files (manifest) and data (localStorage). Before that, wondering if I should do a split version and test passing the whole formatted html div instead of just JSON objects in response to xhr requests.

Exit mobile version