aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes AJAX Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "AJAX Question" Watch "AJAX Question" New topic
Author

AJAX Question

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, I actually ran across a use for AJAX on a website I am working on. Stripped down, I am selecting an image from a list and I need to refresh the image on the page. Simple enough.

I am calling a Servlet to process the request and calling the servlet without using AJAX works fine, so I know that is not the problem. So I have to assume it is my JS. Both alert messages are popping up from the updateImage() function, but it would appear that my servlet is never being called. Any help is appricated.

Thanks.


[ August 19, 2005: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, changed some code and now the servlet is getting called. However, the img tag is not being updated. I know I am retrieving correct values because I had alert debugs in before. After a selection change, the img src is still "" instead of the image path.

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

FYI - changing

<img name="theImage" src=""/>

to

<img id="theImage" src=""/>

didn't make any difference.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, I am stupid. Made the img tag a div with the appropriate ID and all is well.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AJAX Question