/    Sign up×
Community /Pin to ProfileBookmark

Netscape: referencing frames and frame onload event

Hello,

I’ve got some code that’s working well in IE, but not working yet in Netscape Navigator. There are two issues I’ve noticed so far regarding frames. And of course, all help is appreciated! ^_^

Here’s the setup: my main page, default.html, is a frameset comprised of two frames; one frame is “list” and the other is “main”.

Also, default.html has the bulk of my javascript functions inside it’s <head> tag so that when users roam around the frames, they don’t need to keep downloading the javascript functions each time, just the html. Hence, the child frames call any javascript functions they need through a “parent.” call.

Here are my two frame problems in Netscape:

(issue 1) The javascript in default.html can’t reference a child frame. For example this code (which is located in default.html):

fraMain = document.frames[‘main’].document;

works well in IE but not in NN. I have a debug alert() call after this that never gets reached in NN, and of course, the fraMain variable is not getting set. What should I do to reference the child frame in Netscape?

(issue 2) My “list” frame calls a javascript function on it’s onload event. Here’s the code (again, this is in default.html):

<FRAME Name=”list” Src=”inkwolf/images/” onload=”javascript:navChapt();”>

Again, the navChapt() function is called whenever the frame is reloaded in IE, but is not being called in NN. What should I do to have the onload event work in Netscape?

By the way, I’ve been testing my site out in Netscape Navigator 7.1, and MS Internet Explorer 6.0.

Thank you so much for the help!

-Matt

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisApr 15.2004 — In NS, documents don't have frames. Windows have frames.
Copy linkTweet thisAlerts:
@SomatoseauthorApr 16.2004 — Thank you so much, gil davis!

That fixed both of those problems! I really do appreciate your help. I changed all of my document.frames references to window.frames and it is working in BOTH NN and IE. I thought for sure I'd have to check for browser type and implement it accordingly to each, but window.frames is working for both, I'm SO happy.

However, there is one more problem I'm having now. And I think this is the last one, everything else seems to be working smoothly. Here it is:

Netscape is not computing this line:

var strPageMon = strPageDate.substring(0,2);

I'm assuming that it doesn't do the substring function. Is there any other way to just pull out those first two characters?

Thanks again!

-Matt
Copy linkTweet thisAlerts:
@SomatoseauthorApr 16.2004 — Ahhhh ... nevermind that last reply. I found out it wasn't the substring command that it was bombing out on, well it was, but the problem really was to be found somewhere else.

Thanks again for your help, Gil, I do appreciate it.
×

Success!

Help @Somatose spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...