Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing pages in different page.

Status
Not open for further replies.

kruxty

Programmer
Jul 17, 2001
197
PT
Let me see if i can explain this well.

I have one page that have a link to open a menu in other page.
And what i need is when one user uses the menu to change the subject, the page is changed in the main window and not on the menu window.
How can i do this?
I use Dreamwever MX, and i tried all the link properties (self, parent, blank and top) and it seems that didn't work at all...
Any help?
 
not 100% sure what you're asking, but it sounds like you're using frames? and you have a nav frame, with all the navigation stuff in it? then you have the main frame which you want the content to open in? If that's the case, you just need to give your frames names (good rhymin'!!) like so:
Code:
<frameset cols=&quot;120,*&quot;>
<frame src=&quot;nav.html&quot; name=&quot;nav&quot;>
<frame src=&quot;main.html&quot; name=&quot;main&quot;>
</frameset>
Then, when you create a link in the nav.html file, just add the target attribute like so:
Code:
<A href=&quot;aboutus.html&quot; target=&quot;main&quot;>About Us</A>
Or, alternatively, put the following in the HEAD section of the nav.html file:
Code:
<BASE target=&quot;main&quot;>
This will automatically open any links in the window named &quot;main&quot; unless you specify the target in your anchor tag, eg <A href=&quot;popup.html&quot; target=&quot;_blank&quot;> - this would open popup.html in a new window.

Well, hope this helps
 
I'm not talking about frames.
What i want is a new window...
I have the main page with one link (menu) that opens another little window with some topics.
This little window will open the contents of the topic chosen in the main window.
This is possible?
 
sure ... that's simple. In the popup window, put the following:
Code:
<A href=&quot;JavaScript:opener.location.href='open_this_in_the_main_page.html'&quot;>Click here to open a topic in the pain page</A>

hope this helps

 
Now the problem is when i click in the popup window, and when changed the main page, appears the link (e.g. menu.htm) on the popup!
Why?
 
yeah, actually I just noticed that too. I dunno why that is, but try this instead, it's more versatile as it's not restricted to just one link:
Code:
<script>
function changeMain(url)
{
opener.location.href=url
}
</script>

</head>
<body>
<a href=&quot;javascript:changeMain('[URL unfurl="true"]http://www.tek-tips.com')&quot;>Tek-Tips</a><br>[/URL]
<a href=&quot;javascript:changeMain('[URL unfurl="true"]http://www.google.com;)&quot;>Google</a><br>[/URL]
<a href=&quot;javascript:changeMain('[URL unfurl="true"]http://www.yahoo.com;)&quot;>Yahoo!</a><br>[/URL]
<a href=&quot;javascript:changeMain('[URL unfurl="true"]http://www.hotmail.com;)&quot;>Hotmail</a><br>[/URL]
 
oops ... slight type, there's a ; after each of the last three URL's, that should be a ' instead of course [lol]
 
I noticed... :D
Tkx for all... finally it works ;)
 
see, you're learning!! did you also notice the typo when I was typing typo!!!!!!!!!! [lol]

Glad it finally worked
 
That script really works, but just when there is only one single page! When there are pages with frames the page is loaded into the top frame (in my case), and i can't see the content of the page, because the top frame is equal the other top frames.
How can i solve this problem?
 
It's a start... but what i want was to change the top frame to! By other menu frame!
Did you understand?
 
so you basicly want to change both the main frame and the top frame using the popup, correct?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top