Jump to content
xisto Community
Sign in to follow this  
demolaynyc

Ajax: Achieve Ajax Program In 5 Lines Of Code!

Recommended Posts

Well Last night, after a week of irritation and errors I finally created an easy Javascript object that easily and quickly allows you to develop an AJAX program in just 5 easy steps!

Here's the link to the object I've created: http://forums.xisto.com/no_longer_exists/
Download it and read the Readme file that's under the same directory: http://forums.xisto.com/no_longer_exists/


Basically what this object does is to connect to a server-side script (".php, .asp, .jsp, etc"), and what ever this script displays is sent back to the AJAX object and calls a function you designated and handles that response. (usually a string of codes, text or boolean)

The steps are all in the Readme file I've provided. I hope you like it and find it useful.

Please take note: This is for developers who have knowledge in Server-Side coding and Javascript.

For questions or concerns or comments, please don't hesitate to post.

Share this post


Link to post
Share on other sites

This seems pretty good. For my AJAX, I created a similar structure. My only suggestion for improvement would be to add additional functions to handle return values, instead of using getElementsByTagName or childNodes. Just a suggestion, but there's no need to do it because what you have is simple and functional, instead of complex.

Share this post


Link to post
Share on other sites

I think I will use it, as I am not really into javascript, I currently use something similar, but if you are posting it here, when I think your Object is much better, the only thing I am willing to know, if it is works under all these browsers? Opera, Firefox, IE and Safari, Konqueror?

Share this post


Link to post
Share on other sites

Sorry Mark420, I wasn't aware it was illegal. My sole purpose was to let everyone from both forum know about it. I won't do it again.

I think I will use it, as I am not really into javascript, I currently use something similar, but if you are posting it here, when I think your Object is much better, the only thing I am willing to know, if it is works under all these browsers? Opera, Firefox, IE and Safari, Konqueror?

Yep, there's a function that tries to create an XMLHTTP request object on all browsers such as Mozilla, IE, Opera, etc.

I'm planning on adding "POST" method option to send the variables for added security.

Share this post


Link to post
Share on other sites

This really seems like a nice little library thing....What would be nice though, and I haven't seen much on it, is for error handling....shouldn't there be some sort of timeout, with a retry (in case somebody has a wireless connection or some other issue where the request gets lost)....I can't stand that when I am on all these websites that use ajax and my connection stops for a second and so the page is stuck on this little animated image thing that says something like "loading" or "sending"...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.