• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Using jQuery.load Between Frames

 
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Say frame 1 contains a list. Frame 2 contains options that controls list content in frame 1.

From frame 2 how do I reload the jsp that builds the list in frame 1 based on user selected options?

How do I control the DIV in frame 1 from frame 2?
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still don't see how .load() or Ajax comes into play at with frames.

And why use frames in the first place? What's the motivation? They're a pain in the butt to deal with.

That said, research how to use parent and the frame name to address them from within script.
 
Steve Dyke
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:
And why use frames in the first place? What's the motivation? They're a pain in the butt to deal with.



What would you suggest I use to display four different sections on the page.

A main project list
An options section to control the main project list

A section to show details of selected project and this page has several tabs on it to show different perspectives of the selected project

A section to show monthly schedule of project

All this on one page.
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Steve Dyke wrote:What would you suggest I use to display four different sections on the page.


What's wrong with <div>?

You can load each independently with .load().

 
Steve Dyke
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:

Steve Dyke wrote:What would you suggest I use to display four different sections on the page.


What's wrong with <div>?

You can load each independently with .load().



I have not used DIV's hardly at all.

Can the locations of these DIV's be controlled so I have four quadrants(different sizes) on the page?
Can the DIV's shrink and expand with window size?
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before diving off into complex web apps, learning HTML is in order. <div> is a fundamental element that you should understand thoroughly.

Everything else is a simple matter of CSS.
 
Steve Dyke
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Before diving off into complex web apps, learning HTML is in order. <div> is a fundamental element that you should understand thoroughly.

Everything else is a simple matter of CSS.



I am looking at the documentation of the div tag.

I cannot figure out how to position my second div in relation to the first using position:relative.

I have first div with width at 80% I need my second div which is width at 20% to position itself on the right hand end of div 1 and I need to to grow and contract as window size changes.
 
Steve Dyke
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I have this DIV thing going okay now except:

If I load a DIV area with a JSP that has an onload call in the body tag it does not get fired.
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without details, can only guess. Are you establishing the handler in a ready handler? That obviously won't work.
 
Steve Dyke
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Without details, can only guess. Are you establishing the handler in a ready handler? That obviously won't work.



What do you mean by ready handler?

What details do you need?

My page has three div's these load initially. One of these div's is a JSP with three tabs. Each tab will load a div within this JSP with an associated JSP. Example: the three tabs are three differnet views of a project.

What I need is when the div that has the three tabs is loaded it automatically loads the div within it.

It will simulate me clicking the first tab after the initial div is loaded.
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Steve Dyke wrote:f I load a DIV area with a JSP that has an onload call in the body tag it does not get fired.


You're putting a body tag inside a <div>?

Why on Earth would you do that? It's completely invalid HTML.

Your load() should return an HTML fragment that's valid to be placed inside the HTML.
 
Steve Dyke
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:

Steve Dyke wrote:f I load a DIV area with a JSP that has an onload call in the body tag it does not get fired.


You're putting a body tag inside a <div>?

Why on Earth would you do that? It's completely invalid HTML.

Your load() should return an HTML fragment that's valid to be placed inside the HTML.



Every JSP file I have created has a body tag.

So:
I load div with .load("A servlet request") This servlet request responds and forwards to a JSP that happens to have an onload call in its body tag. This all gets loaded into div right?
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Steve Dyke wrote:Every JSP file I have created has a body tag.


Invalid.

Anything you are returning to insert into the DOM, must be valid to place into the DOM at that point. A full HTML page with a body cannot be embedded into another HTML page.

This all gets loaded into div right?


Yes, but unsuccessfully.

You can't just ignore the rules of HTML and expect things to work.
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic