473,382 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

go to a specific id on parent frame

Instead of: window.parent.frames["main"].location.reload;

I would like to go to the top / bottom of the parent frame, but how?
with no reload.
Jul 29 '07 #1
15 3104
On Jul 29, 12:54 pm, Rasmussen <wrote:
Instead of: window.parent.frames["main"].location.reload;

I would like to go to the top / bottom of the parent frame, but how?
with no reload.
Do you mean "scroll to"?

Peter

Jul 29 '07 #2
On Sun, 29 Jul 2007 20:24:14 -0000, Peter Michaux
<pe**********@gmail.comwrote:
Do you mean "scroll to"?
Yes.

Jul 29 '07 #3
On Sun, 29 Jul 2007 22:32:53 +0200, Rasmussen <wrote:
Do you mean "scroll to"?

Yes.
I found out this:

function scrUp() {
window.parent.frames("main").scrollTo(0,0)
}

But I have: <base target = "main">

And it does not work with that.
Jul 29 '07 #4
On Jul 29, 4:56 pm, Rasmussen <wrote:
On Sun, 29 Jul 2007 22:32:53 +0200, Rasmussen <wrote:
Do you mean "scroll to"?
Yes.

I found out this:

function scrUp() {
window.parent.frames("main").scrollTo(0,0)
The frames object not a function. You had the syntax right in your
original post.
}

But I have: <base target = "main">

And it does not work with that.
What does one have to do with the other?

Jul 29 '07 #5
On Sun, 29 Jul 2007 14:05:31 -0700, David Mark
<dm***********@gmail.comwrote:
The frames object not a function. You had the syntax right in your
original post.
}

But I have: <base target = "main">

And it does not work with that.

Ok, this works:
function scrUp() {
window.parent.frames("main").scrollTo(0,0)
}
function scrDw() {
window.parent.frames("main").scrollTo(0,8888)
}
What does one have to do with the other?
It works from the "menu" frame, and there are several links to "main"
But I removed <base target = "main">
so it works ok now.

Could the code be better/different?

Jul 29 '07 #6
On Sun, 29 Jul 2007 23:34:39 +0200, Rasmussen <wrote:
so it works ok now.
But unfortunately not with FF :-(

Jul 29 '07 #7
On Jul 29, 5:34 pm, Rasmussen <wrote:
On Sun, 29 Jul 2007 14:05:31 -0700, David Mark

<dmark.cins...@gmail.comwrote:
The frames object not a function. You had the syntax right in your
original post.
}
But I have: <base target = "main">
And it does not work with that.

Ok, this works:
function scrUp() {
window.parent.frames("main").scrollTo(0,0)
}
function scrDw() {
window.parent.frames("main").scrollTo(0,8888)
}
No it doesn't. I repeat: the frames object is not a function.
Firefox will tell you this in the error log. IE is stupid.
>
What does one have to do with the other?

It works from the "menu" frame, and there are several links to "main"
But I removed <base target = "main">
so it works ok now.
I still don't see what the base target has to do with this script.
>
Could the code be better/different?
Yes. You could use proper brackets (eg square ones) to reference
properties of the frames object.

Jul 29 '07 #8
ASM
En réponse à Rasmussen qui nous a susurré, en date du : 29/07/07 23:42,
le message sibyllin suivant :
On Sun, 29 Jul 2007 23:34:39 +0200, Rasmussen <wrote:
>so it works ok now.

But unfortunately not with FF :-(

of corse ! with ("main") insteed of ["main"] ... !

function scrUp() {
window.parent.frames["main"].scrollTo(0,0);
return false;
}
function scrDw() {
window.parent.frames["main"].scrollTo(0,8888);
return false;
}

The menu frame file :

<html>
<base target="main">
<div id="udDown">
<p><a href="#" onclick="return scrUp();">top</a>
<p><a href="#" onclick="return scrDw();">bottom</a>
</div>
<div id="menu">
<p><a href="page1.htm">page 1</a>
<p><a href="page2.htm">page 2</a>
<p><a href="page3.htm">page 3</a>
</div>
</html>

--
Stephane Moriaux et son (moins) vieux Mac
Jul 29 '07 #9
David Mark wrote:
On Jul 29, 5:34 pm, Rasmussen <wrote:
<snip>
>Ok, this works:
function scrUp() {
window.parent.frames("main").scrollTo(0,0)
}
function scrDw() {
window.parent.frames("main").scrollTo(0,8888)
}

No it doesn't. I repeat: the frames object is not a function.
Firefox will tell you this in the error log. IE is stupid.
<snip>

In javascript a function is an object and so the object that is the -
frames - collection (or any collection) may be a function. On IE, Opera
and (as I recall) Safari (along with others) they are functions (and
some will even say 'function' as a result of - (typeof frames) -).
Calling a collection with name as the argument is never going to be
cross-browser because some collections are not functions, but there is
nothing to say they may not be.

Richard.

Jul 29 '07 #10
On Jul 29, 7:33 pm, "Richard Cornford" <Rich...@litotes.demon.co.uk>
wrote:
David Mark wrote:
On Jul 29, 5:34 pm, Rasmussen <wrote:
<snip>
Ok, this works:
function scrUp() {
window.parent.frames("main").scrollTo(0,0)
}
function scrDw() {
window.parent.frames("main").scrollTo(0,8888)
}
No it doesn't. I repeat: the frames object is not a function.
Firefox will tell you this in the error log. IE is stupid.

<snip>

In javascript a function is an object and so the object that is the -
frames - collection (or any collection) may be a function. On IE, Opera
Opera too. That is odd.
and (as I recall) Safari (along with others) they are functions (and
some will even say 'function' as a result of - (typeof frames) -).
Anyway, the OP was having trouble with FireFox and it is clearly not a
function in FireFox. I'm sure the error log says as much when the OP
runs his code.

Jul 30 '07 #11
David Mark wrote:
On Jul 29, 7:33 pm, Richard Cornford wrote:
>>On Jul 29, 5:34 pm, Rasmussen <wrote:
Ok, this works:
<snip>
>In javascript a function is an object and so the object that
is the - frames - collection (or any collection) may be a
function. On IE, Opera

Opera too. That is odd.
Not really. Opera are in a commercial business where imitating the
features of IE is worth-while. They have to accept the fact that there
are web sites out there that are written to be IE only, and to keep
their customers happy they create a browser that can handle (most of)
them.
>and (as I recall) Safari (along with others) they are functions
(and some will even say 'function' as a result of - (typeof frames)
-).

Anyway, the OP was having trouble with FireFox and it is
clearly not a function in FireFox.
Didn't the OP say his code 'worked'? That mans he is not having trouble
with Firefox, it means he has not tried the code in Friefox (or any
Mozilla/Gecko browser) at all.
I'm sure the error log says as much when the OP
runs his code.
Absolutely it will, though it may be an 'if' rather than a 'when'.

Richard.

Jul 30 '07 #12
On Jul 29, 8:29 pm, "Richard Cornford" <Rich...@litotes.demon.co.uk>
wrote:
>
Didn't the OP say his code 'worked'? That mans he is not having trouble
with Firefox, it means he has not tried the code in Friefox (or any
Mozilla/Gecko browser) at all.
No. He replied to himself:

On Sun, 29 Jul 2007 23:34:39 +0200, Rasmussen <wrote:
so it works ok now.
But unfortunately not with FF :-(

Jul 30 '07 #13
On Mon, 30 Jul 2007 00:57:02 +0200, ASM
<st*********************@wanadoo.fr.invalidwrote :

Error console reports: parent.frames is not a function.
of corse ! with ("main") insteed of ["main"] ... !
Thanx, that did it.

The <base target="main"does that
\index.html is drawn (one level up index.html)

Never mind, I put the target on the links.
Jul 30 '07 #14
On Mon, 30 Jul 2007 01:29:48 +0100, "Richard Cornford"
<Ri*****@litotes.demon.co.ukwrote:
Didn't the OP say his code 'worked'? That mans he is not having trouble
with Firefox, it means he has not tried the code in Friefox (or any
Mozilla/Gecko browser) at all.
At first I did only test with IE6,
ten I found out that it didn't work in FF.

I test with FF, IE6 and Opera.

BTW: It's not poosible to check with AOL browsers (?)
Jul 30 '07 #15
Rasmussen said the following on 7/30/2007 3:27 AM:
On Mon, 30 Jul 2007 01:29:48 +0100, "Richard Cornford"
<Ri*****@litotes.demon.co.ukwrote:
>Didn't the OP say his code 'worked'? That mans he is not having trouble
with Firefox, it means he has not tried the code in Friefox (or any
Mozilla/Gecko browser) at all.

At first I did only test with IE6,
ten I found out that it didn't work in FF.

I test with FF, IE6 and Opera.

BTW: It's not poosible to check with AOL browsers (?)
Sure it is. If you don't have AOL, post a URL and I will be happy to
test it. But, with regards to frames, the AOL browser behaves precisely
as IE does since AOL simply embeds a stripped down version of IE.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 30 '07 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hari Prasad | last post by:
I wrote an application where I am trying to kill a parent frame with out killing the child one. I have created a frame (F1) and if I click a button on F1 I am getting a new frame (F2). Now, if...
1
by: Stuart Wexler | last post by:
Let's say I have a frameset page and I want to preselect an option in a select box from the parent frame. So the parent frame would programmatically change the select box in the child frame. ...
26
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function...
3
by: KathyB | last post by:
Hi, Been reading a LOT about frames, variables, etc. I realize you can NOT use server.transfer with target frames (which are client)... I have a Parent frame containing Left and Right frames....
18
by: Chris Ianson | last post by:
Hi geniuses (or is that genii, or genies) The challenge is as above really. I have a page with an iframe in it, and need to call a JS function in the *parent* page, *from* inside the iframe. ...
4
by: many_years_after | last post by:
Hi, pythoners: My wxPython program includes a panel whose parent is a frame. The panel has a button. When I click the button , I want to let the frame destroy. How to implement it? Could the...
0
by: dazzler | last post by:
How do I add "background text" into MDI parent frame, the text will be now erased if I move the MDI Parent frame, or I can also erase text with moving MDI Child frame, need to somehow refresh the...
1
by: michal.podlewski | last post by:
Hi All, I have a problem with a simple (as I thought till now) thing: I want to make a link in a child-window which would change site in the parent-window and along with closing child window. The...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.