Hi,
I need code for “ajaxy text links” on a page with the following characteristics:
- Each link takes the following arguments: URL, text_not_clicked, text_clicked, text_retrieved, text_timeout, time_out_time (in seconds)
- When clicked, the link does all of the following:
o retrieve page specified by URL, invisibly in background
o change text from text_not_clicked to text_clicked immediately on click
o change text to text_retrieved when page specified by URL has been fully retrieved
o change text to text_timeout if page specified by URL is not retrieved within time_out_time seconds
o work with any number of other ajaxy links being clicked concurrently (i.e. one link being clicked and doing its thing in the background should not interfere with clicking another link on same page and starting a another background action, and so on)
o retrieved information does not need to be stored anywhere (the links will be used to invoke CGI scripts)
Make it so that inserting such links on a page involves having a block with the function code on top; let’s call the function ajaxlink(URL, text_not_clicked, text_clicked, text_retrieved, text_timeout, time_out_time); so an html page with such links would look similar to this:
CODE BLOCK
ajaxlink (“[login to view URL]”, “Click here #1”, “Working”, “Done”, “Connection Problem”, 5)
<p>
ajaxlink (“[login to view URL]”, “Click here #2”, “Working”, “Done”, “Connection Problem”, 5)
<p>
ajaxlink (“[login to view URL]”, “Click here #4”, “Working”, “Done”, “Connection Problem”, 5)
Make it so that the links can be styled.
For the code, use unique variables so that it will be able to coexist with other Javascript code on a page.