Solved

BookMark and QueryString

Posted on 2004-08-20
5
422 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Send email using HTML and PHP in separate file 5 41
Validating Date Part2 2 27
Add a little space on either side of a table. 12 25
html form layout 4 36
This article discusses four methods for overlaying images in a container on a web page
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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 …

733 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