Forums

This topic is locked

opening links in parent html page

Posted 23 Aug 2007 12:16:53
1
has voted
23 Aug 2007 12:16:53 Donnelle Dabreo posted:
Hi,

I've been stuck on this for the last few days and was wondering if you could help me. I'm not even sure if using javascript is the best option to do this, but if you could help me anyway that would be great. My dilemma is I'm designing a website which has several links in the left hand navigation bar. But at the moment, the links open in a new window. I don't want that. I want them to open in the main area of the parent window. Normally if i'd used frames, opening the links within that same page wouldn't have been a problem because I could just use the target attribute.

But I didn't use frames, I used CSS layouts but when I set the target attribute to _parent, the links open up across the whole page rather than just in the main section. Should I include javascript to open the links in the main section (called mainContent) in the parent page? If so, could you provide some code to point me in the right direction of how to do this?

Replies

Replied 20 Nov 2008 15:49:46
20 Nov 2008 15:49:46 srinivas kondareddy replied:
Hi

Did anyone got the solution to this problem... I am also struck in the same scenario. Someone please help me to sort it out this issue.




<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hi,

I've been stuck on this for the last few days and was wondering if you could help me. I'm not even sure if using javascript is the best option to do this, but if you could help me anyway that would be great. My dilemma is I'm designing a website which has several links in the left hand navigation bar. But at the moment, the links open in a new window. I don't want that. I want them to open in the main area of the parent window. Normally if i'd used frames, opening the links within that same page wouldn't have been a problem because I could just use the target attribute.

But I didn't use frames, I used CSS layouts but when I set the target attribute to _parent, the links open up across the whole page rather than just in the main section. Should I include javascript to open the links in the main section (called mainContent) in the parent page? If so, could you provide some code to point me in the right direction of how to do this?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Replied 21 Nov 2008 11:01:45
21 Nov 2008 11:01:45 Alan C replied:
Hi Guys,
I don't know if this is the answer or not, but it's worth consideration.
I have just been reading an AJAX book, to decide whether or not there are opportunities to use some of the techniques on my sites. It sounds really interesting. The bit of interest to you is that Javascript (or other languages) can access the whole of the page using the Document Object Model (DOM).

My understanding is that the access is somewhat like selectors in CSS, but only loosely so. The author referred to it as DOM scripting, I did a quick search on it but most of what came up was books rather than techniques or detail. In essence it allows you to access the document (your page) and change it. The access is by id, that's where my suggestion of being like css comes in, but you can also access by tag.

It does not look easy, looking at the examples I would say it's not for Javascript novices, or indeed coding novices, but it looks like it will do what you want.

My experience so far is limited. I would be interested to know if you go this route and how it turns out.

Reply to this topic