Page 1 of 1

URL query string AND internal page link ?

Posted: Mon Oct 01, 2012 4:15 pm
by califdon
I want to have an anchor link with a target of the same page, but with a $_GET query string AND a reference to an internal #link. That is, I want to refresh the page (for pagination) and return it to the appropriate place on the page, which is several scrolls from the top. When I try to do this like:

Code: Select all

<a href='index.php#comments?start=10'>Next</a>
it ignores the internal link. When I try this

Code: Select all

<a href='index.php?start=10#comments'>Next</a>
it gets totally lost!

But this works just fine, except of course it contains no $_GET data:

Code: Select all

<a href='index.php#comments'>Next</a>
I haven't found anything useful by searching the web.

Re: URL query string AND internal page link ?

Posted: Mon Oct 01, 2012 5:06 pm
by twinedev
What browser are you using? Here is an example I saw when googling this that DID work for me in FF, Chrome and IE

http://www.idc-online.com/course_schedu ... a#Edmonton

Re: URL query string AND internal page link ?

Posted: Mon Oct 01, 2012 6:02 pm
by califdon
Wow! That's exactly what I've been trying to do, and I thought I had tried that combination, but now I'll go back and check what I did. Thanks! I thought that should work, but either it didn't work or my eyes were glazing over, because I was using Firefox primarily, and checking it in IE8, as I always do, and your link works fine in FF.

Re: URL query string AND internal page link ?

Posted: Mon Oct 01, 2012 6:21 pm
by califdon
:oops: Well, you know the old story: "Now it works!" I must have had some other flaw in my code, before! Thanks again.