473,480 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Loading only the image using javascript function

2 New Member
Hi,

I need to load only the image in a JSP without refreshing the entire page.

I have an action class which sends the stream of the image and I call this action class from 'src' of <img> tag in JSP. I have two links, next and previous. Clicking on them should fetch a different image and replace the current image. Currently I'm making a fresh request and loading the entire page afresh. But I don't want to refresh the entire page but only the image portion. How can I do this? I can use javascript but not ajax.

Thanks.

Prasanna
Oct 26 '07 #1
3 1694
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

Just change the src property of the image. For example:
[HTML]<img id="image" src="img/img01.gif">[/HTML] to change the src:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("image").src="img/img02.gif";
Oct 26 '07 #2
hegdepras
2 New Member
Yeah.. that works, thanks :)
Just for curiosity... Say I have a page which shows live quotes froma stock market (may be a market watch page) and I need to refresh it every second to get latest data. Is possible to show only the changed prices of stocks without flickering the page, using javascript?

Thanks,
Prasanna
Oct 26 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Just for curiosity... Say I have a page which shows live quotes froma stock market (may be a market watch page) and I need to refresh it every second to get latest data. Is possible to show only the changed prices of stocks without flickering the page, using javascript?
You could do, but it depends how you want it displayed within the page.
Oct 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
6926
by: nick | last post by:
Dear All, I have a little strange problem with using innerHTML property to update my browser document. The HTML content I am inserting in document contains images. These images are to be...
1
9088
by: John Pastrovick | last post by:
Is there a way to load an image locally (in the client) when a selection of a file is made using input type=file. The purpose is to allow selection of a file and put the image in the browser...
11
1695
by: JS | last post by:
Dear Group, I have a webpage of small images. At the bottom is a Javascript function. If someone scrolls impatiently to the function link, when the action is complete the html does not continue...
4
44024
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup...
2
1730
by: John | last post by:
Hi all, I'm having a problem loading images for later use in javascript on the client. In my code-behind, I'm using a stringbuilder object to build and populate a few javascript variables like :...
6
2550
by: Ivan Bútora | last post by:
I have recently looked at http://alistapart.com/articles/imagegallery to implement a simple picture gallery on a webpage that I'm working on. Everything works fine; however, I have one question....
5
10309
by: toffee | last post by:
Hi all, I've seen a really cool effect which i would like to use on an intranet site. Am referring to the 'LOADING..' animation you see when switching pages. I've seen it somewhere on a website...
2
4744
by: abrtlt | last post by:
I am using Ajax with a PHP script to obtain the name of gif files from a MySQL database. Javascript then embeds the actual file in the web page, thus displaying the image on the fly. For precise...
1
3392
by: agatha.life | last post by:
I did a javascript for the loading of images (I didn't want to have the images loaded in "on loading" because they are too many). The website is for a model and if you look at the codeof pages (...
1
1880
by: mlikesit | last post by:
I am trying to get the following code to pre-load some images before re-dirrecting the user. The problem is that the onError event gets called for all of the images immediately. I've tripple...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.