Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > link target question

Reply
Thread Tools

link target question

 
 
don
Guest
Posts: n/a
 
      05-18-2005
I'm trying to have a link to a page open up to a specific spot on the same
page - I'm familiar with

<a href = "Purchase.html" target = "new window"> Buy Product </a>

but my code needs to do this

<a href = "Purchase.html" target = "buybox"> Buy Product </a>


and then down a few lines I have

<div class = "buybox" name = "buybox">this is the result box</div>



 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      05-18-2005
Previously in alt.html, don <> said:

> I'm trying to have a link to a page open up to a specific spot on the same
> page


<a href="#buybox">Buy Product</a>
....
<div class="buybox" id="buybox">this is the result box</div>

http://www.w3.org/TR/html4/struct/global.html#adef-id

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      05-19-2005
Previously in alt.html, don <> said:

> here is a pic of what I'm trying to do


This is a plain text newsgroup - please don't post binary. If you want
to show an example, post a link.

> I'd like the links on the left to
> open up in the white box


It sounds like rather than linking to another part of the page, you
actually want to insert/replace part of the content of the page. There
are basically 2 ways of doing this:

1) Reload the page, using server-side script to insert the additional
content.

2) Use client-side script to insert/display the additional content.

1 is preferred, but requires server-side scripting of some sort
(whatever flavour you prefer/have available). 2 doesn't require any
server-side scripting to be available on the server, and will generally
be quicker, but won't work at all for visitors with scripting
disabled/unavailable.

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
Leif K-Brooks
Guest
Posts: n/a
 
      05-19-2005
Mark Parnell wrote:
> It sounds like rather than linking to another part of the page, you
> actually want to insert/replace part of the content of the page. There
> are basically 2 ways of doing this:
>
> 1) Reload the page, using server-side script to insert the additional
> content.
>
> 2) Use client-side script to insert/display the additional content.


FWIW, you'll be able to do this with pure CSS when browser support for
CSS3 becomes a bit better. Example:
<http://tw.ecritters.biz/html_examples/fragment_hide/>.
 
Reply With Quote
 
don
Guest
Posts: n/a
 
      05-19-2005
ok - thanks for the info -

"Leif K-Brooks" <> wrote in message
news:ciTie.6901$...
> Mark Parnell wrote:
> > It sounds like rather than linking to another part of the page, you
> > actually want to insert/replace part of the content of the page. There
> > are basically 2 ways of doing this:
> >
> > 1) Reload the page, using server-side script to insert the additional
> > content.
> >
> > 2) Use client-side script to insert/display the additional content.

>
> FWIW, you'll be able to do this with pure CSS when browser support for
> CSS3 becomes a bit better. Example:
> <http://tw.ecritters.biz/html_examples/fragment_hide/>.



 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      05-19-2005
Previously in alt.html, Mark Parnell <>
said:
> 1) Reload the page, using server-side script to insert the additional
> content.


don <> said (in email):
> what would this link line look like?


OTTOMH, something along these lines:

<a href="purchase.php?action=buy">buy</a>
....
<div>
<?php if ($_GET['action'] == 'buy') then {
echo("<p>Buy stuff, or whatever you want to show here</p>");
} ?>
</div>

BTW: In future, please reply to the group, so everyone gets the benefit
of any replies.

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
don
Guest
Posts: n/a
 
      05-19-2005
Well - I'm writing the php code now to insert the second html page right
back into the first page, but my next question is if the second page has
another submit button, how do I deal with two submit buttons? The second
page is going to be a <form> for the user to submit and get processed by a
third page......

"Mark Parnell" <> wrote in message
news:1nxv53pk2jo3.l9p2zva7s7bw$. om.au...
> Previously in alt.html, Mark Parnell <>
> said:
> > 1) Reload the page, using server-side script to insert the additional
> > content.

>
> don <> said (in email):
> > what would this link line look like?

>
> OTTOMH, something along these lines:
>
> <a href="purchase.php?action=buy">buy</a>
> ...
> <div>
> <?php if ($_GET['action'] == 'buy') then {
> echo("<p>Buy stuff, or whatever you want to show here</p>");
> } ?>
> </div>
>
> BTW: In future, please reply to the group, so everyone gets the benefit
> of any replies.
>
> --
> Mark Parnell
> http://www.clarkecomputers.com.au
> alt.html FAQ :: http://html-faq.com/



 
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
Problem in setting Target Node and Target Tree Property mohit ASP .Net 0 01-23-2008 05:41 AM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
changing link's target to blank page Cesar Garcia H ASP .Net 0 04-15-2005 07:12 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