Beginning with Ajax

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Jul 2009
Posts: 93
Reputation: AshtonHogan is an unknown quantity at this point 
Solved Threads: 1
AshtonHogan AshtonHogan is offline Offline
Junior Poster in Training

Beginning with Ajax

 
0
  #1
Sep 22nd, 2009
Hi,

I'm starting to learn Ajax after playing around with JSP and Javascript, I felt the need for interaction without reloading the page.

I've searched everywhere for a simple java servlet/ajax example that I can play around with but just found a lot of asp and complex java examples.

Could someone please give me something as basic as typing a name in a text field and text being displayed beneath the text field after the word/letter has been typed. i.e. User must enter a name that is 3 or more letters else the text says "Error".

I'm currently using Netbeans, so if the example could work there, that wold be preferable!

Thanks a lot,
-Ashton.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,419
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 229
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: Beginning with Ajax

 
0
  #2
Sep 22nd, 2009
The example you described isn't AJAX, that's just standard Javascript validation. AJAX would be, for example, as the user types display a list of possible selections underneath the box.

http://w3schools.com/ajax/ajax_intro.asp
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 93
Reputation: AshtonHogan is an unknown quantity at this point 
Solved Threads: 1
AshtonHogan AshtonHogan is offline Offline
Junior Poster in Training

Re: Beginning with Ajax

 
0
  #3
Sep 22nd, 2009
Don't be silly... you know very well that it could be done with Ajax.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,419
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 229
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: Beginning with Ajax

 
0
  #4
Sep 22nd, 2009
Originally Posted by AshtonHogan View Post
Don't be silly... you know very well that it could be done with Ajax.
Sure, it COULD be done with AJAX but there is absolutely no reason to. The term/acronym AJAX describes making a request to the server then receiving and parsing XML. There is absolutely, positively no reason to do something so complex for validation.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 93
Reputation: AshtonHogan is an unknown quantity at this point 
Solved Threads: 1
AshtonHogan AshtonHogan is offline Offline
Junior Poster in Training

Re: Beginning with Ajax

 
0
  #5
Sep 22nd, 2009
I said that I'm starting to learn it... I just want to view how ajax works altogether in action to see how it allows requests/responses without reloading a page. I want to see how it runs a servlet without reloading the page. In the most basic form possible. Preferably on a Netbeans project. I've read a couple of tutorials and w3schools and so on, but I want to play around with it on Netbeans.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,419
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 229
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: Beginning with Ajax

 
0
  #6
Sep 22nd, 2009
It isn't a Netbeans project but it is a JSP AJAX primer (found by searching AJAX JSP on google...) http://www.ics.uci.edu/~cs122b/proje...SPExample.html

It should also be noted that while it is very important that you are familiar with your IDE it's just as important to not become absolutely dependent upon it.
Last edited by ShawnCplus; Sep 22nd, 2009 at 1:43 pm.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 93
Reputation: AshtonHogan is an unknown quantity at this point 
Solved Threads: 1
AshtonHogan AshtonHogan is offline Offline
Junior Poster in Training

Re: Beginning with Ajax

 
0
  #7
Sep 22nd, 2009
Thanks, but that doesn't really help. I've also found lots of casual ajax examples. They don't work on Netbeans though...
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 318
Reputation: Thirusha is an unknown quantity at this point 
Solved Threads: 51
Thirusha's Avatar
Thirusha Thirusha is offline Offline
Posting Whiz

Re: Beginning with Ajax

 
0
  #8
Sep 23rd, 2009
Try these two links, I havent tried them, but they seem to be pretty good
http://www.devarticles.com/c/a/Java/...with-Servlets/

http://www.java-tips.org/java-ee-tip...echnology.html

There are also loads of examples out there, you just have to search for them.

When i first started learning jsp, I came across a lot of examples that were incomplete, dont be discouraged though, just try solving them yourself, google helps a lot, a lot of the errors are newbie errors. but you will get the hang of it.
Life... Is a Moment
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 93
Reputation: AshtonHogan is an unknown quantity at this point 
Solved Threads: 1
AshtonHogan AshtonHogan is offline Offline
Junior Poster in Training

Re: Beginning with Ajax

 
0
  #9
Sep 23rd, 2009
Thanks... I've already done the drop down list example and got it to work on Netbeans... It's a bit complicated though, I want something simple like the example I explained initially...
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 93
Reputation: AshtonHogan is an unknown quantity at this point 
Solved Threads: 1
AshtonHogan AshtonHogan is offline Offline
Junior Poster in Training

Re: Beginning with Ajax

 
0
  #10
Sep 23rd, 2009
Hi,

I found an easy Ajax example here:
http://www.w3schools.com/Ajax/ajax_serverscript.asp

It also contains a demo of the end product.

The only problem is that it requires a "time.asp" but does not contain much information on how to do that. I come from a JSP background and don't know anything at all about asp... Would it be possible to translate the code snippet they gave to JSP? Below is the asp code I need to translate to JSP:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <%
  2. response.expires=-1
  3. response.write(time)
  4. %>

Thanks,
-Ashton.
Reply With Quote Quick reply to this message  
Reply

Tags
ajax

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for ajax
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC