Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use onClick event to abort a function

Status
Not open for further replies.

davidl

Technical User
Sep 20, 2000
4
IN
Hi,

I'm using a proprietary on line survey system (on an IIS platform), where pages of questions are generated sequentially based on previous responses.

I have a function which pre-loads some images into cache to be used on later survey pages.

My problem is: I have a "Next page" button which submits some data and requests the next page. When the button is clicked I want the pre-load function to stop (immediately -not when the current image has finished loading), so that the browser will show the next page as soon as possible.

Is there a way to abort this pre-load function, &/or stop the current request to the server (ie. current image download)?

Any ideas would be greatly appreciated.

Thanks,

David Lord [sig][/sig]
 
Set a flag in the next page function, and in the load images function, check if it's set and stop loading if so.
[sig]<p>nick bulka<br><a href=mailto: > </a><br>[/sig]
 
Thanks Nick,

I thought that was the way to do it and have been working on putting a flag into my function - but I'm still left with the problem of the current image being downloaded before the next page request goes to the server. Is there a way of stopping the image download in progress? (some of my images are large - hence my wanting to pre-load them). I'm trying to eliminate the delay between clicking on the &quot;next page&quot; button and the request going to the server, as it appears to respondents that nothing happens after they click &quot;Next&quot;.

Cheers,

David. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top