Saturday, December 15, 2007

XmlHttpRequest script 2.0

Quite a while ago, I told you about this script that I had written, which would make xmlHttpRequests for me. Now I have made a version 2.0, I ramp up all the way to the next major version umber. Why? Because there are considerable changes, including ones in syntax.
I changed the name of my function, added an argument (called args for irony's sake). Besides that the script now supports POST calls besides the regular GET calls. Also, it no longer ought to make any kind of complain when new requests are made before the first one is finished.
The script is available from here, but there are some things I really want to say. For my bandwidth (even though it won't matter much) and your security, do not include the script right from my website. Instead, download it, and put it with your website on a host and then include it using a script tag. And to make sure I won't mistake you for a "includer" do not link directly to the file, link to this post instead.
If you stick to these few rules you can use my script. A guide is to be found within the file (all commented out of course) - using the script shouldn't be too hard. Good luck with your web designing.

Changelog

  • changed the name of main function from send to request
  • added an argument to request in preparation for POST support
  • changed GET cases to work with new args argument
  • added POST support
  • made XMLHttpRequest variable local - solving problems with multiple calls after eachother
  • renamed the XMLHttpRequest variable from submitting to XHRequest
  • removed time-out as changes should have taken away any reason for it
  • deleted highPrioritySend function, as it would do nothing now
  • removed global variables busy and time_out that were related to time outs
  • made receive an inline, unnamed function inside request - allowing easier variable names
  • removed global variable next_function, as this allowed todo to be used directly (woot, no global variables anymore)

Wednesday, December 12, 2007

POST in xmlHttpRquests

Just a quick hello and dropping by a link. It's what helped me getting POST working in xmlHttpRequest.
The point is that you actually need to set some headers, to go along with that request. No long story about it for now, just a link: http://www.openjs.com/articles/ajax_xmlhttp_using_post.php

Hope it helps some of you out.

The dilemma of a blog

Once again I have not posted in a while. And that's while so much happened.

That's exactly my problem. When I have much to do, I have much to tell, but very little time to tell it. When I don't have much to do, I have enough time, but not so much to tell.

I just stopped by to share that revelation, and to so hi to you all of course.

Hi!