The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How do you include BOTH an anchor and a parm in a link?
Mark Wilson
post Mar 1 2007, 06:02 PM
Post #1





Group: Members
Posts: 3
Joined: 1-March 07
Member No.: 2,064



First off, I'm not sure if this is a client-side or server-side issue, so I'm gonna try both places - sorry!

I have a file, news.php, which generates a page based on the parameter "issue" which is sent from a link.
Example:
a href="news.php?issue=26"

So far, all well and good. BUT... I want to be able to link to anchors which are in that page, anchors which correspond to individual articles.
If the page were static, or at least didn't need the "issue" parameter, I could say:
a href="news.php#articleId77" and I'd get the right page, scrolled to anchor "articleId77".

BUT... how do I COMBINE them?
I've tried "news.php?issue=26#articleId77", and of course the program can't find the "issue" parameter.
I've tried "news.php#articleId77?issue=26", same result.

I could make the articleId a regular parameter, but then I don't know how to scroll to it automatically, as the "#anchorRef" option does so nicely. Help!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Mar 1 2007, 06:27 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE(Mark Wilson @ Mar 1 2007, 03:02 PM) *
BUT... how do I COMBINE them?
I've tried "news.php?issue=26#articleId77", and of course the program can't find the "issue" parameter.
That's odd. The server-side program shouldn't see the #articleId77 part at all. The browser should request news.php?issue=26 from the server and then go to id="articleId77" (or name="articleId77") on its own.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mark Wilson
post Mar 1 2007, 07:19 PM
Post #3





Group: Members
Posts: 3
Joined: 1-March 07
Member No.: 2,064



QUOTE(Darin McGrew @ Mar 1 2007, 06:27 PM) *

QUOTE(Mark Wilson @ Mar 1 2007, 03:02 PM) *
BUT... how do I COMBINE them?
I've tried "news.php?issue=26#articleId77", and of course the program can't find the "issue" parameter.
That's odd. The server-side program shouldn't see the #articleId77 part at all. The browser should request news.php?issue=26 from the server and then go to id="articleId77" (or name="articleId77") on its own.

mad.gif OK, I apologize to all. I tried it again, just as I showed it here, and this time it worked. Beats me what the problem was, but undoubtedly some sort of operator error. Foo.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 03:22 PM