aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes About frames in jsp 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 "About frames in jsp" Watch "About frames in jsp" New topic
Author

About frames in jsp

Ashutosh Arya
Ranch Hand

Joined: Oct 07, 2008
Posts: 69
Hi,

I have a scenario in which I am having two frames in one parent page.I want to use the javascripts used in the page included via frame in the main parent page so that if I use the javascript function in the child page it effects the whole parent page.

Right now the js is effecting only the child page(included via frame).

I have tried including the js function in the parent page but in that case the function is not working as the call to the function is inside the child page.

Please help me out regarding this.

Aashu.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

This should probably be in HTML/JavaScript.

I think you'd have to explicitly call the parent's JS function (parent.blah() or something like that, I don't recall).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61421
    
  67

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP. For more information, please read this.

This post has been moved to a more appropriate forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ashutosh Arya
Ranch Hand

Joined: Oct 07, 2008
Posts: 69
Thanks Bear,I will keep that in mind from next time.

Please elaborate the solution if you can.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61421
    
  67

The child frames can reference the parent via parent.
Ashutosh Arya
Ranch Hand

Joined: Oct 07, 2008
Posts: 69
Thanks for the solution Bear but if I explicitly call the function from parent window the effect of the function is limited to child window only as the call to the function is in child window.

I want the effect of the javascript function (actually being used to open a dhtml window) to be shown over parent(i.e.,the dhtml window should superimpose parent frame).

A little explanation:

I am having two frames in a jsp.Each frame is used to show a separate jsp.
Now the top frame is containing some header jsp and some javascript function which is used to open a dhtml window when we click on a relevant link.

The problem is that this new window is being superImposed by the bottom frame thus hiding the dhtml window.I want that the dhtml window superimpose both the frames.

I hope now you can help me out.

Aashu.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It can not happen, the two frames are "seperate" windows, hence why you really should not use frames in applications theses days.

Eri
Ashutosh Arya
Ranch Hand

Joined: Oct 07, 2008
Posts: 69
Thanks Eric..

Now In place of using frame I am trying to include that page inside <td> tags.But still I am not able to include a servlet which is responsible for output of one frame?

How can I include a servlet using jsp include tag?

Or please suggest any other better approach for the scenario.

Thanks again.

Aashu
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61421
    
  67

Ashutosh Arya wrote:How can I include a servlet using jsp include tag?

Using the JSP include action (not the directive) simply reference the URL of the servlet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About frames in jsp