Solved

BookMark and QueryString

Posted on 2004-08-20
5
420 Views
Last Modified: 2008-03-03
Say i have a URL

http://www.a.com/test.asp?ID=10&Day=Sun

How do I make it go to a bookmark with the same Querystring

for e.g.

1. http://www.a.com/test.asp#BookmarkName?ID=10&Day=Sun OR
2. http://www.a.com/test.asp?ID=10&Day=Sun#BookmarkName

either of the above does not work.
:) SD
0
Comment
Question by:sciber_dude
  • 4
5 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 11855478
both methods work for me on IIS.  What webserver are you using?
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 11855543
<HTML>
<HEAD>
<SCRIPT language="javascript">
 function querystring(name)   // returns a named value from the querystring
 {
   var tmp = ( location.search.substring(1) );
   var i   = tmp.toUpperCase().indexOf(name.toUpperCase()+"=");

   if ( i >= 0 )
   {
      tmp = tmp.substring( name.length+i+1 );
      i = tmp.indexOf("&");
      return unescape( tmp = tmp.substring( 0, (i>=0) ? i : tmp.length ));
   }

   return("");
 }
</SCRIPT>
</HEAD>

<BODY onload='location.replace("#"+querystring("anchor"));'>
<P><A href="#bottom" name="top">bottom</a>
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P>content
<P><A href="#top" name="bottom">top</a>
</BODY>
</HTML>
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 125 total points
ID: 11855553
in the page above, you would do this:

 http://www.a.com/test.asp?ID=10&Day=Sun&anchor=BookmarkName

if you sub "bottom" for "BookmarkName" in the example above it will work
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 11855571
you can do this to verify:

<BODY onload='alert(querystring("Day"));location.replace("#"+querystring("anchor"));'>
0
 
LVL 11

Author Comment

by:sciber_dude
ID: 12044768
Thanks.

:) SD
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question