Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Ajax: Achieve Ajax Program In 5 Lines Of Code!
demolaynyc
post Mar 17 2007, 06:35 PM
Post #1


Premium Member
Group Icon

Group: Members
Posts: 330
Joined: 2-February 06
Member No.: 11,040



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.
Go to the top of the page
 
+Quote Post
bluefish
post Mar 18 2007, 05:28 AM
Post #2


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 71
Joined: 16-December 06
Member No.: 18,419



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.
Go to the top of the page
 
+Quote Post
Quatrux
post Mar 18 2007, 10:01 AM
Post #3


the Q
Group Icon

Group: [HOSTED]
Posts: 1,022
Joined: 13-July 05
From: Lithuania, Vilnius
Member No.: 7,059



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?
Go to the top of the page
 
+Quote Post
Mark420
post Mar 18 2007, 01:35 PM
Post #4


The Modernator
Group Icon

Group: Members
Posts: 486
Joined: 6-August 06
From: The Interweb!
Member No.: 15,021



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

Go to the top of the page
 
+Quote Post
demolaynyc
post Mar 19 2007, 05:44 PM
Post #5


Premium Member
Group Icon

Group: Members
Posts: 330
Joined: 2-February 06
Member No.: 11,040



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.
Go to the top of the page
 
+Quote Post
Mark420
post Mar 19 2007, 10:24 PM
Post #6


The Modernator
Group Icon

Group: Members
Posts: 486
Joined: 6-August 06
From: The Interweb!
Member No.: 15,021



No probs - if you didnt know,you didnt know wink.gif
Go to the top of the page
 
+Quote Post
.:Brian:.
post Apr 5 2007, 02:20 PM
Post #7


Premium Member
Group Icon

Group: Members
Posts: 219
Joined: 13-February 07
Member No.: 20,371



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"...
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Code To Send An Email From A Form(7)
  2. Google Adsense(24)
  3. Clicksor(7)
  4. Do You Program/code Your Own Games(11)
  5. Wuts A Good Game Maker Program?(12)
  6. Does Anyone Code Using Turing(2)
  7. Myspace Code Changing(10)
  8. Favorite Graphics Program?(64)
  9. Uploading Image File Through JSP Code To Server(9)
  10. Which Virus-protection Program Is The Best?(18)
  11. Dynamically Change The Background Image On Mouse Effects!(3)
  12. A Free Graphic Design Program That Could Equal Photoshop?(35)
  13. Drag&drop Js With Ajax(3)
  14. Gba Game Program(5)
  15. Mixing XHTML 1.1 And iFrame(9)
  1. Disable Task Manager 1 Line Code![vb6](32)
  2. Decompile An Exe To Source Code(10)
  3. Best Free Anti-virus Program(16)
  4. Best Program To Tune Up An Old Computer?(9)
  5. Dynamic Php Image And Better Php Code Question(10)
  6. Designing A Summer Running Program(1)
  7. Need Help With Code For Battle Calculator For An Mmorpg I Am Planning(0)
  8. Code To Text Ratio Tool(0)
  9. C++ Meters To Feet And Feet To Meters Program(0)
  10. Php Random Selector(2)
  11. Activation Code(7)
  12. Instant Replay Code?(0)
  13. Tuning Car Studio(2)


 



- Lo-Fi Version Time is now: 7th September 2008 - 04:05 AM