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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to jump back to link clicked on page

Status
Not open for further replies.

NickyJay

Programmer
Sep 1, 2003
217
GB
Hi all
Wonder if i can make enough sense of this for anyone to help!

I have an admin page with a list of links to view careers leaflets.

From the list the user has the option to open the leaflet, print it, delete it or tag it as completed ready for viewing on the main website.

The page works fine except when the make live page opens and closes, refreshing the list to show a tick icon to indicate that leaflet has been dealt with, it automatically jumps back to teh top of the page instead of to the last link that was clicked.

There are about 100 or so listed leaflets and the users are asking if the page will refresh but move down to the last leaflet they were at.

Is there any javascript onclick that will remember the last position on the page when it is refreshed?

Any advice is gratefully received, im a bit lost on this one and havn't a clue on how to explain it in the google seach box!

Thanks!!!
 
Why use JavaScript? Why not use a bog-standard HTML bookmark?

If you give your list items an ID, e.g:

Code:
<li id="item12">...</li>

then you can jump back to it by appending a bookmark to the URL, in the above case it would be "#item12".

Hope this helps,
Dan





Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hiya, Thanks for you reply!

I think that's possiblly what i need more than js then; i assume i add the item to the url im using to click away from the page (to my popup), then how do i get the url in the button to close the pop and go back to the main page? sorry if im being a bit basic but some of the things i ought to know i dont yet!

Thanks!
 
Given we have no idea of the code that re-loads the page, it would be hard to comment.

Can you post your code, or better still, a URL?



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Here's the code thate generates the list of links:
Code:
          <cfoutput query="qryLeaflet"> 
            <tr>
			
              <td width="65"><a name="#qryLeaflet.LeafletCode#"></a>#qryLeaflet.LeafletCode#<cfif isDefined("qryLeaflet.RecordLocked") AND #qryLeaflet.RecordLocked# NEQ 'N'>
                  <img style="background-color: red;" alt="locked" border="0" src="img/lock.png" /> 
                  <cfelse>
                </cfif> </td>
              <td width="240"><a href="update_english.cfm?leafletid=#qryleaflet.leafletid#">#leafletTitle#</a></td>
              <td width="85">#DATEFORMAT(DateUpdated, "mmm yyyy")#</td>
              <td><a href="./output_leaflet.cfm?leafletid=#qryleaflet.leafletid#" class="mini-button" target="_blank">Output</a></td>
              <td><a href="./update_factors.cfm?leafletid=#qryleaflet.leafletid#&firstletter=#url.firstletter#" class="mini-button">Factors</a></td>
              <td width="90"><a href="./update_keywords.cfm?LeafletCode=#LeafletCode#" class="mini-button">Keywords</a></td>
              <td width="40"><a href="./print_leaflet.cfm?leafletid=#qryleaflet.leafletid#" target="_blank"><img src="img/printer.png" border="0" /></a></td>
              <td width="40"><a href="delete_leaflet.php?leafletcode=#qryleaflet.leafletcode#"><img src="img/cross.png" border="0"/></a></td>
			  <td width="40"><cfif #publish# NEQ 'N'><img src="img/tick.png" border="0"/><cfelse><a href="addtopublished.php?LeafletID=#LeafletID#&ToPublish=YES" target="_blank"><img src="img/add.png" border="0" /> </a></cfif></td>
			</tr>
			
          </cfoutput>

although i'm using coldfusion in there, the links are the main part im concerned with at the mo' - the users want to be able to click the link to "publish" the leaflet - the last link. The list produced is about 60 links long, and they don't want to keep scrolling back to the last one they clicked all the time.

Thanks everyone for taking a look at this!

Nicola
 
no, this is the code that generates the list of links, the code to close the popup and return to this list is:
Code:
<script>
	function saveandclose(){
		top.opener.location.reload(true);
		window.close();
	}
</script>

Thanks :)
 
Are you passing the reference through to the popup? If so, how?

We need to know this so we can advise on how to pass it back again.



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top