Interframe communication

S

Stevo

Randy said:
Stevo said the following on 11/26/2007 12:42 AM:
Damn, you beat me to it.

Seriously though Mr Wael, here's how you do it.

Go to google.com and type in the following (adding only the word
JavaScript to your original question):

Is it possible to access an array that is in another frame javascript

and choose from the numerous examples of how to access variables in one
frame from another.

This Google thing might turn out to be useful, is it too late to invest?
 
W

Wael

But, but, that isn't what you asked :)
How do I communicate between frames in a browser?

Imagine that, it is a question in this groups FAQ. Number 4.8 to be
specific.

It even answers your specific question about variables in another frame.

To me this is communication between two frames :) Otherwise, how would
you interpret this? May be there is a new trick to learn and i asked
it by mistake.

Anyway, here is what i've been trying to do for two days now

var reqFrame = window.top.frames(3).frameElement;
alert(reqFrame.src);
or reqFrame.src = "http://www.yahoo.com"

I haven't been able to do anything more useful with this. i can access
objects that either have no value or have values that i am not really
interested in.

I am using google groups, so i don't know how to go to FAQ 4.8

Thanks for having the potential to help ;))
 
S

Stevo

Wael said:
var reqFrame = window.top.frames(3).frameElement;

frames isn't a function, so you shouldn't be trying to "call" it with
the parameter value 3. Switch out that (3) and replace it with [3] and
you'll get a bit further.
 
W

Wael

Wael said:
var reqFrame = window.top.frames(3).frameElement;

frames isn't a function, so you shouldn't be trying to "call" it with
the parameter value 3. Switch out that (3) and replace it with [3] and
you'll get a bit further.


Sorry guys,
still the same problem after i changed to square brackets.
// alert(reqFrame.ownerDocument.name);
reqFrame.loadImages();

Both of these don't work. I am not sure how to access the underlying
document where "reqFrame" is. i am able to access the reqFrame.name,
but not sure how to go after. loadImages is a function in the page
where reqFrame is pointing. Of course i wouldn't load the images from
another page. i am just trying to access anything on that page. Even
with faq4.8
 
W

Wael

Telling us "my code doesn't work" is tantamount to me saying "My stereo
doesn't play music, why?" without showing you the stereo or even
explaining that I unplugged the thing.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/- Hide quoted text -

- Show quoted text -
As you can see, the complexity of my page dictates the use of all
those frames.
http://www3.sympatico.ca/sedky69/
 
W

Wael

Sorry i forgot to mention that the problem are on those two pages
br_frame.html
middle_right_frame.html

what i am trying to do is change an image on the middle_.. html page,
but for now i can't access anything on that page. Just the frame that
contains it.
 
W

Wael

I don't agree with that assessment. You should view that page with a
browser window that is 800 pixels wide or so. It is horrendous.

<URL:http://members.aol.com/_ht_a/hikksnotathome/waelsedky.jpg>

Not a very pleasing look.

Make the lower right "frame" a div element with absolute positioning and
the rest of your "frames" can be made part of the page itself. One
document, no frames. It even solves your JS issue because then you have
no frames to try to communicate across.


Part of my last reply, that you snipped, included this:

<quote>
And in that page, try to explain, simply, what you are trying to do.
</quote>

that's bad news. back to the drawing board. i haven't used <div>
before. i am using html because photoshop creates the file for me. i
just have to tweak it, add scripts, etc.

here is what i was originally trying to do. because of the odd
position of my buttons, i could not use an "onmouseover" event
(because how would i place the new image), so i used image maps and to
make the page look a lively a bit, i was going to have an icon
displayed in the frame that i cannot access. it didn't work.

i am relying on visuals on my page more than anything else.
 
T

Thomas 'PointedEars' Lahn

Wael said:
that's bad news. back to the drawing board. i haven't used <div>
before. i am using html because photoshop creates the file for me. i
just have to tweak it, add scripts, etc.

`div' *is* a proper standardized HTML element type since HTML 4.01. That
specification, which also introduced CSS support, went Recommendation on
1999-12-24, and some features of it were supported a while before that.
You must have overslept at least the last 7 years:

http://www.w3.org/TR/html401/
here is what i was originally trying to do. because of the odd
position of my buttons, i could not use an "onmouseover" event
(because how would i place the new image),

You are not making sense. The event listener does not need to modify the
`img' element's position:

http://PointedEars.de/hoverMe
so i used image maps

There is nothing wrong with that as long as you provide the `alt' attributes
for the `area' elements:

http://www.w3.org/TR/html401/struct/objects.html#h-13.6
and to make the page look a lively a bit, i was going to have an icon
displayed in the frame that i cannot access.

You don't need frames for that. Probably you don't even need client-side
scripting; :hover could suffice.

http://www.w3.org/TR/CSS21/
it didn't work.
http://www.jibbering.com/faq/faq_notes/clj_posts.html#ps1DontWork

i am relying on visuals on my page more than anything else.

Which is why you should not, by using frames, make matters more complicated
and inaccessible than they need to be.


Please provide an attribution line above your quotations next time:
http://www.jibbering.com/faq/faq_notes/clj_posts.html


PointedEars
 
A

akela_p501usa

work your way thru text as such...

The purpose of this library is to allow IFRAME objects to be dragged
around the screen in the same way that popup windows or draggable DIV
tags are often used. Since IFRAME objects always cover form objects,
this makes an ideal solution for a simulated "popup window" on a page
with form objects.

It requires almost no code to function, making it the easiest script to
get up and running quickly!

dragiframe.js




Chace [‡] Daggers
 
T

Thomas 'PointedEars' Lahn

Randy said:
Thomas 'PointedEars' Lahn said the following on 11/30/2007 11:47 AM:

Who said it wasn't? The OP clearly said he hadn't used it before.
Nothing more, nothing less. Especially not that it wasn't part of HTML.

I understood the OP's emphasizing that they are "using HTML because ..." in
Yeah, we all know how well supported :hover is on images in the most
predominant browser on the web. Makes it pretty useless.

You are missing the fact that these are graphical links.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Randy said:
Thomas 'PointedEars' Lahn said the following on 12/1/2007 5:24 AM:

Has nothing to do with whether it is a "graphical link" or not. Telling
someone to use something that is not supports in the most predominant
browser on the web is a wasted effort. It is almost as bad as telling
someone to use an IE-only feature.

IE supports the :hover pseudo-class for `a' elements, too.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Randy said:
Thomas 'PointedEars' Lahn said the following on 12/1/2007 5:43 AM:

I will refrain from telling you "No shit, Sherlock"

That is wise.
and simply tell you that a :hover rollovers won't work in IE.

You are wrong, they do.
The only thing you can do is style the link itself, not change an image
inside the link.

Exactly, and that behavior is not restricted to IE. Therefore, you should
try http://PointedEars.de/scripts/test/dom/hoverMe/hoverMe-css

However, since image display support is separate from CSS support, and
prefecthing does not need to be available, I prefer to use the scripting
approach.

BTW, IE 7 does support :hover for other elements than A. I have tested it
successfully for DIV, P, IMG, DT, and DD elements.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Randy said:
Thomas 'PointedEars' Lahn said the following on 12/1/2007 8:26 AM:

Only because I don't want to read your whining.


No thanks, I prefer solid solutions.

My solution is the proof that :hover rollovers with images would work in IE,
which proves you wrong. But you are unwilling or incapable of admitting
that. I would not be surprised if you had not even looked at the code
before replying. You have also snipped the provision that I included for my
solution, considering the rest of your behavior, probably intentionally.


PointedEars
 
W

Wael

<iframe style="position:absolute;left:200px;top:200px;"
src="iframeSRC.html" name="myIFrame"></iframe>

change the iframeSRC.html to your page. Then tinker around with the top
and left to get it where you want it. Then simply target="myIFrame" on
your links to open them in the IFrame.
I am gonna go through all those suggestions and see what works best
for me. I like the idea of having everything on one page. I've tried
the iframes, but i ended up with scrollbars in the main text area.
that's why i had to split the page into multiple frames.

I am not a web programmer that's why i am using an archaic technology.
It is basic html
 
T

Thomas 'PointedEars' Lahn

T

Thomas 'PointedEars' Lahn

Wael said:
I am not a web programmer that's why i am using an archaic technology.
It is basic html

CSS :hover has nothing to do with programming, as have `div'
and `iframe' elements nothing to do with not being basic HTML.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,834
Members
47,380
Latest member
AlinaBlevi

Latest Threads

Top