Ajax: Achieve Ajax Program In 5 Lines Of Code!

free web hosting
Free Web Hosting > Computers & Tech > How-To's and Tutorials > Programming > Client Side Scripting > Javascript

Ajax: Achieve Ajax Program In 5 Lines Of Code!

demolaynyc
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://www.demolaynyc.astahost.com/ajaxConn/ajaxConn.js
Download it and read the Readme file that's under the same directory: http://www.demolaynyc.astahost.com/ajaxConn/Readme.html


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.

 

 

 


Reply

bluefish
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.

Reply

Quatrux
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?

Reply

Mark420
Notice from Mark420:
I have seen the same post here http://www.trap17.com/forums/index.php?sho...ve+Ajax+Program
Please dont do this again! the rules are you can have an account here and at Trap but you must NOT post the same posts in both forums


Reply

demolaynyc
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.

QUOTE
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.

Reply

Mark420
No probs - if you didnt know,you didnt know wink.gif

Reply

.:Brian:.
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"...

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : ajax achieve ajax program lines code

  1. Is Their A Free Or Express Program To Help Make Javascript, Or How Do I Do It. - i want to make javascript but dont know how. (0)
  2. Ajax: Introductory Tutorial - XML, XMLHttpRequest/ActiveX, tutorial (0)
    In this tutorial I will attempt to introduce you to the basics of AJAX programming. AJAX is
    basically the name given to a type of programming combining server-side and client-side scripting to
    create a seamless web application that is both secure and functional. It has all the benefits of web
    sites and regular applications. Here are a few key features that attract so many people to this type
    of programming: -Instant feedback to user -No waiting for pages to load because loading is done in
    background -Easy communication with server to allow security and functionality at ...



Looking for ajax, achieve, ajax, program, 5, lines, code

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for ajax, achieve, ajax, program, 5, lines, code
advertisement




Ajax: Achieve Ajax Program In 5 Lines Of Code!



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE