Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
can an anchor be appended with instructions for destination page?
Old 01-25-2011, 02:42 AM can an anchor be appended with instructions for destination page?
seannarae's Avatar
Skilled Talker

Posts: 65
Location: san francisco, ca
Trades: 0
Cant provide code example just yet. Just trying to provide proof-of-concept, yes/no, doable/not-possible feedback for client. I'll create test page examples if the following explanation doesnt describe

GOAL
Id like an HREF anchor on a page to carry with it instructions regarding what to hide/show on the destination page when it loads. These special HREF anchors would be on multiple pages, each carrying unique instructions regarding which ID's on that page to SHOW/HIDE.

MENU PAGE
  • List of anchors at top
  • Each anchor has jQuery .click function to SHOW corresponding DIV with list of links, and HIDE all other link list DIVs
  • When user clicks a link within one of those lists, they go to new page, say: Article page.

ARTICLE PAGE
  • On the Article page, a BACK link would return to MENU page with same DIV shown or hidden
  • A straight -1 history call will load MENU page in default state.
  • I need it to load with specific IDs shown/hidden (via jQuery).

SO BASICALLY
I'm wondering how that BACK link would need to be appended with instructions to the MENU page, to tell it which DIV lists to show or hide

AGAIN
Each Article page will need to have unique instructions. That is: "on load, hide all link links but the one i came from"

CRUDE EXAMPLE
a page containing "Articles from List A" would have a BACK link with special instructions to
<a href="menu.html" (show #list_a) (hide #list_b) (hide #list_c)>Back to List A</a>

Apologies for the nebulous descriptions. Hope there's enough detail to garner a solution.
seannarae is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-25-2011, 07:54 AM Re: can an anchor be appended with instructions for destination page?
Junior Talker

Posts: 2
Name: stone
Trades: 0
I like the concept...
I can't think of any way to do what you're asking except with frames.
stonethegardner is offline
Reply With Quote
View Public Profile
 
Old 01-25-2011, 09:27 AM Re: can an anchor be appended with instructions for destination page?
Extreme Talker

Posts: 246
Trades: 0
use a querystring

<a href="menu.html?show=#list_a">

First hide all divs, then show only the one that you want to show.

You can try using this plugin for getting the querystring values (I haven't used it)
http://plugins.jquery.com/project/query-object
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
Old 01-25-2011, 01:58 PM Re: can an anchor be appended with instructions for destination page?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
HTML Code:
<a href="javascript:history.go(-1);">Back to previous page</a>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-25-2011, 06:04 PM Re: can an anchor be appended with instructions for destination page?
seannarae's Avatar
Skilled Talker

Posts: 65
Location: san francisco, ca
Trades: 0
@chrishirst

perhaps i could have been clearer with this point:
A straight -1 history call will load MENU page in default state.

What I meant was that a -1 history call wont do because i loads the MENU page in its default state: with all lists hidden. I need the MENU page to load with specific DIV ID's shown or hidden.

@stbuchok
Thanks for the tip; Looking into Query Strings.
seannarae is offline
Reply With Quote
View Public Profile
 
Old 01-25-2011, 06:23 PM Re: can an anchor be appended with instructions for destination page?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
history.go(-1) will take the user back to the last page they viewed in exactly the same state as they left it, as it will be loaded from the browser cache.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-25-2011, 06:36 PM Re: can an anchor be appended with instructions for destination page?
seannarae's Avatar
Skilled Talker

Posts: 65
Location: san francisco, ca
Trades: 0
RESOLVED

javascript.go(-1) totally *does* do what i need it to.

Thanks once again @chrishirst. I think thats 3 pints i owe you.
seannarae is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to can an anchor be appended with instructions for destination page?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33484 seconds with 12 queries