Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > linking to page absolute location

Reply
Thread Tools

linking to page absolute location

 
 
Phil
Guest
Posts: n/a
 
      11-29-2008
Is there a way preferrably without javascript to link to a webpage
jumping to a specific location. Kind of like scrollTo()?

--
Phil


 
Reply With Quote
 
 
 
 
Harlan Messinger
Guest
Posts: n/a
 
      11-29-2008
Phil wrote:
> Is there a way preferrably without javascript to link to a webpage
> jumping to a specific location. Kind of like scrollTo()?


Yes, if the page has anchors on it (either A tags with NAME attributes,
or tags with IDs) and you link to thatpage.html#identifier.
 
Reply With Quote
 
 
 
 
Tim Greer
Guest
Posts: n/a
 
      11-29-2008
Phil wrote:

> Is there a way preferrably without javascript to link to a webpage
> jumping to a specific location. Kind of like scrollTo()?
>


Sure, just like you would on the page itself, you just provide the full
URL/link to the same location on the page, which that page must have
within it, of course. Nothing unusual needs to be done.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
 
Reply With Quote
 
Sherm Pendley
Guest
Posts: n/a
 
      11-29-2008
"Phil" <> writes:

> Is there a way preferrably without javascript to link to a webpage
> jumping to a specific location. Kind of like scrollTo()?


Yes, if the "location" has a name (for anchor elements) or id (for other
elements) to identify it. For instance:

<h2><a name="section1">Introduction</a></h2>
<h2 id="section2">More stuff</h2>

Then, you can link specifically to these elements by including a
fragment identifier in your link's URL:

<a href="example.html#section1">The introduction</a>

Or, if it's on the same page as the link, you can use the fragment
identifier by itself:

<a href="#section2">More stuff</a>

More info here:

<http://www.w3.org/TR/WD-html40-970917/struct/links.html>

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
 
Reply With Quote
 
cwdjrxyz
Guest
Posts: n/a
 
      11-29-2008
On Nov 29, 12:13*pm, "Phil" <st...@basketball.net> wrote:
> Is there a way preferrably without javascript to link to a webpage
> jumping to a specific location. Kind of like scrollTo()?


Since a few may have Javascript turned off for whatever reason, you
are right to be concerned with avoiding Javascript if the page you
wish to link to is important to the intent of your site. I likely
would use server side script, such as PHP, since it can not be turned
off by the viewing browser. One other concern about having any kind of
automatic link to another page is the security settings being used.
Some security suites and security settings allowed by some browsers
can be set to not allow such automatic links or to allow them only
after giving you a warning that you are being taken to another page.
To be on the safe side, some add a text link you can use if you are
not automatically taken to the new desired page for whatever reason,
and others just use a text link to click.
 
Reply With Quote
 
Phil
Guest
Posts: n/a
 
      11-29-2008
Harlan Messinger wrote:
|| Phil wrote:
||| Is there a way preferrably without javascript to link to a webpage
||| jumping to a specific location. Kind of like scrollTo()?
||
|| Yes, if the page has anchors on it (either A tags with NAME
|| attributes, or tags with IDs) and you link to
|| thatpage.html#identifier.


reply to all

what I meant to imply by 'absolute location' is without using typical
anchor id tags.

I want to refer to other pages not under my control but of course there
will not be a convenient tag where I want it so I need to have the
window jump to a location in the page.

I was hoping I could do it by maybe there was a way to specify byte
location or something to get close.

 
Reply With Quote
 
Tim Greer
Guest
Posts: n/a
 
      11-29-2008
Phil wrote:

> Harlan Messinger wrote:
> || Phil wrote:
> ||| Is there a way preferrably without javascript to link to a webpage
> ||| jumping to a specific location. Kind of like scrollTo()?
> ||
> || Yes, if the page has anchors on it (either A tags with NAME
> || attributes, or tags with IDs) and you link to
> || thatpage.html#identifier.
>
>
> reply to all
>
> what I meant to imply by 'absolute location' is without using typical
> anchor id tags.
>
> I want to refer to other pages not under my control but of course
> there will not be a convenient tag where I want it so I need to have
> the window jump to a location in the page.
>
> I was hoping I could do it by maybe there was a way to specify byte
> location or something to get close.


I don't see how, unless you use a browser-side language, such as
JavaScript, etc., and if you could, that would rely on something they
might not have on their end (not installed or not enabled). You could
control where they start viewing it on your end, but on the browser
end, just linking to another site, I'm not so sure.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
 
Reply With Quote
 
Sherm Pendley
Guest
Posts: n/a
 
      11-29-2008
"Phil" <> writes:

> I want to refer to other pages not under my control but of course
> there will not be a convenient tag where I want it so I need to have
> the window jump to a location in the page.


Without a named anchor or another element with an id, there's no
location to which to jump.

> I was hoping I could do it by maybe there was a way to specify byte
> location or something to get close.


Nope.

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      11-29-2008
In article <S2gYk.9369$>,
"Phil" <> wrote:

> Harlan Messinger wrote:
> || Phil wrote:
> ||| Is there a way preferrably without javascript to link to a webpage
> ||| jumping to a specific location. Kind of like scrollTo()?
> ||
> || Yes, if the page has anchors on it (either A tags with NAME
> || attributes, or tags with IDs) and you link to
> || thatpage.html#identifier.
>
>
> reply to all
>
> what I meant to imply by 'absolute location' is without using typical
> anchor id tags.
>
> I want to refer to other pages not under my control but of course there
> will not be a convenient tag where I want it so I need to have the
> window jump to a location in the page.
>
> I was hoping I could do it by maybe there was a way to specify byte
> location or something to get close.


I am reminded of Korpela's suggestion, in another thread (a Miguel
thread), that one advantage of an author IDing all his elements would be
that other authors could link into his pages.

Anyway, good question. I expect it could be something very useful to be
able to take someone to a specific part of someone else's very long page
that is not decked out with any IDs that can be latched onto.

One thing that long pages are always decked out with are words and
phrases. There should be a way to <a href="reallyLongPage#'Tired with
all these, for restful death I cry,'">A page of sonnets</a>

--
dorayme
 
Reply With Quote
 
cwdjrxyz
Guest
Posts: n/a
 
      11-30-2008
On Nov 29, 12:43*pm, "Phil" <st...@basketball.net> wrote:
> Harlan Messinger wrote:
> || Phil wrote:
>
> ||| Is there a way preferrably without javascript to link to a webpage
> ||| jumping to a specific location. Kind of like scrollTo()?
> ||
> || Yes, if the page has anchors on it (either A tags with NAME
> || attributes, or tags with IDs) and you link to
> || thatpage.html#identifier.
>
> reply to all
>
> what I meant to imply by 'absolute location' is without using typical
> anchor id tags.
>
> I want to refer to other pages not under my control but of course there
> will not be a convenient tag where I want it so I need to have the
> window jump to a location in the page.
>
> I was hoping I could do it by maybe there was a way to specify byte
> location or something to get close.


I can see one possible way. You would have to locate a position on the
page where a certain word or group of words appears that will serve as
your target. Then, using server side PHP, a header exchange would
examine the page using regular expressions to locate the word or words
you choose as the target for the page. The page is then made to scroll
down to where these words first appear. This sort of thing often is
done to find the first instance of a word or group of words in a file.
I have not tried this, so I do not have an example at hand. If you ask
at a php ng, someone might have an example. This likely could also be
done with Javascript with the disadvantage that it would not work for
those who turn their script off.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does one get an absolute absolute file path? James Byrne Ruby 3 09-14-2010 06:02 PM
wonder if I should use absolute URL in internal linking Jeff ASP .Net 3 02-01-2010 07:10 PM
Location, location, location =?Utf-8?B?VHJhY2V5?= Wireless Networking 2 02-17-2007 08:37 PM
How to trick a page into running at a location different from it'sphysical location? Luke Dalessandro ASP .Net 0 01-15-2006 05:59 AM
Absolute cursor location =?Utf-8?B?U2lkIFMu?= ASP .Net 4 12-09-2004 03:37 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57