wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Help - PLEASE HELP ME...Function on clik to display page on diferent frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Help - PLEASE HELP ME...Function on clik to display page on diferent frame" Watch "Help - PLEASE HELP ME...Function on clik to display page on diferent frame" New topic
Author

Help - PLEASE HELP ME...Function on clik to display page on diferent frame

Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12

Hello,
I am a begginer on java scripts, and I do not know much about them, but if anyone could please try to help me, please....
my problem is the following:
I have my site made in 2 frames.
So, the top Frame is a navigation bar with link and submenus like a cascade menu.
My problem is that when you click on a link in a Sub menu, the page will apear in a new page, and the top frame disapears.
What I want Is that when you click on an link on the top frame, the linked page apears on the bottom frame, and keeps the top frame always there.
This is the script:
function clic() {
les liens vont eval"<"."delay = setTimeout"<".\"parent.document.location = links"<"." + this.no + "]"<"." + this.page + "]\",10)"); }

Can Someone tell me what do I have to change so that the links displayed as I explained???
Thank you very much
P.S - I am desperate!
[ October 10, 2002: Message edited by: Cristina Proenca ]
[ October 10, 2002: Message edited by: Cristina Proenca ]

Regards,<p>Cristina
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Cristina
JavaScript is not Java.
I'm going to move this to the HTML and JavaScript forum.


Dave
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

try changing
parent.document.location
to
parent.frames[1].document.location


SCJP
Visit my download page
Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12
Randall,

Thank you so, so, so, very much!!!
You just saved my life!!!
It works.
You have no Idea, for a week now I have been trying to place the right code with no sucess.

Thak you, thank you, thank you!
Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12
Randall,
Altough it works, it's giving me an error message:
It Says:
Line:0
Error:'parent.frames.1.document' is not an object
Do you Now Why???
Thank's,
Cris
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

double check your code and make sure it reads parent.frames[1].document not parent.frames.1.document
better yet, in your frameset, give your frames names. for example:

<html>
<head>
<title>Magic Items</title>
</head>
<frameset cols="35%,65%" border="0" framespacing="0" frameborder="0">
<frame src="Index.html" name="MIIndex">
<frame src="Blank.html" name="MIMain">
</frameset>
<noframes>
This page requires a frames-capable browser.
</noframes>
</html>

then you could say MIMain.document
i hope that helps. like i said im no expert though
Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12
Hi Randal
I tried to do as you told me, but i got the same problem.
Maybe it's not really a problem.
You see, some of the submenus have links to word, excel and powerpoint documents ( I am building an Intranet in my work )and the problem is after opening a word document, if I click on another link on the submenu, it doesn't work, and displays the error, but if I click on a link that does not have submenus it goes back to normal.
I don't know if the problem concernes a conflict with the office documents or not.
Do you think there's a way to solve it?:
I am sorry to be troubling you so much, but I do thak you a lot.
Please forgive my english, it's been a while since I write in english Language ( I am from portugal ). rolleyes:
Regards,
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

your english is fine. i have never done menus. my guess is once you are in the menu, the current object is no longer the frame so parent refers to the frame not the frameset. hopefully someone with more experience with this can help.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What code are you using?? Menu?? That would help out in figuring what the problem is...
Eric
Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12
Eric,
I don't understand your question
Can you plesase be more especific?
The frameset is built with frontpage2000, and has 4 scripts attached, that are : links.js, navig.js, functions,js and dhtml.js.
I don't know if any of this ansewers your questions.
Please give me a hint.
Thank's
cristina
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Did you find this DHTML menu online? If so where...If I know what the menu is, I might be able to help you.
Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12
Eric,
Please, visit www.europcar.com and you will get the ideia.
The diference is I built mine with a frameset, and theirs is built on single pages.
Nevertheless my problem is only when the submenus open office documents. If the links on the submenus open html pages, there's no problem.
Hope to hear from you soon.

Cristina
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

im confused now. you can open Word, Excel, and Powerpoint files from a browser now?
Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12
Yes Randall,
I can open word, excel and powerpoint documents, and even visio documents from a browser.
I can do this because they are inside the web.
I am building an Intranet web site, and the web and all the documents are saved within the web server.
If I do the links correctly the documents open in the bottom frame, leaving the top frame visible.
In the navigation bar ( top frame ) I have links to html documents and links to word, excel and powerpoint documents.
They really have to be in this format because this intranet is viewed by all the users in my work, and they also need to print them in this format.
I have also included links inside this documents to open other office documents related.
So you see, I only have problems when clicking on a submenu link to a word,excel or powerpoint, and after the document opens if I try to click on another link on the submenus to another document ( html or not ). Then I have to clik on a link in the main menu, and not on submenus for it to open.
If you have someway of helping me, please let me know.
Thank's,
Cristina
Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12
Ok,
So the error that is giving me is:
Line:0
Error:member not found
This happens after opening a word document, with a link on a submenu, and trying to open another word document in the submenu.
Do you understand this?
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

your statement of the problem is pretty clear. i hope someone can help you with it. im not much of an expert at javascript, i much prefer server side scripting using php or jsp or servlets. i have no experience with intranets and have never served up anything other than .html, .jsp, and .php through a browser.
Cristina Proenca
Greenhorn

Joined: Oct 10, 2002
Posts: 12
Thank's anyway Randall.
Maybe someone else can give me a hint.

Cristina
Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
When you use some tools, like FrontPage to create a page, it can generate a lot of code that may be hard to deal with manually.
I guess that you tried to embed some code into the generated code, and you get problem there.
Why don't you post the relevant code here, then other people can help you more easily.


Thanks,<br />Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help - PLEASE HELP ME...Function on clik to display page on diferent frame