The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> opening <a> link in different <div> of same window
akkw
post Aug 6 2008, 07:49 PM
Post #1





Group: Members
Posts: 4
Joined: 6-August 08
Member No.: 6,359




Greetings:

How can one target an anchor <a> to open a file in another <div> in the same window, i.e.

<div id="right">

<a href="newfile.txt" target="left">Open new file</a>

</div>

<div id="left">

</div>

Apologies for this simple question.

Thanks.

Alfred
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Aug 6 2008, 08:09 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



You can't. You can target a frame (either a regular frame or an inline frame, but frames have their own problems. Of course, the JavaScript approach has the same problems of frames, plus the extra JavaScript dependency.

A better approach is to have a separate URL for each document, and to link to the other URLs.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Website Design Perth
post Aug 6 2008, 08:21 PM
Post #3


Newbie
*

Group: Members
Posts: 14
Joined: 6-August 08
From: Perth, Western Australia
Member No.: 6,367



Have a look at the jQuery javascript library. This is what we use, for example, to 'hide' a div on page load, and then 'display' it on click of a link/button.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 6 2008, 08:53 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Which isn't the same as opening another page. Why do you use jQuery for something that basic BTW?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Website Design Perth
post Aug 6 2008, 11:01 PM
Post #5


Newbie
*

Group: Members
Posts: 14
Joined: 6-August 08
From: Perth, Western Australia
Member No.: 6,367



True - I was referring to the original post.

Usually because it's not the only kind of functionality we employ.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
akkw
post Aug 7 2008, 07:49 PM
Post #6





Group: Members
Posts: 4
Joined: 6-August 08
Member No.: 6,359



Thanks for the suggestions.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 10:32 PM