Solved

this (onload) works in netscape, but not in ie.. help!?!

Posted on 1997-11-01
7
234 Views
Last Modified: 2013-12-25
OK... I've got a site I'm building using frames.  Here's the default page setup:

<frameset rows="8%,6%,*" border=0 framespacing=0 frameborder=0>
<frame src="nav.htm" name="nav" marginwidth=5 marginheight=0 scrolling=no>
<frame src="nav1.htm" name="nav2" marginwidth=5 marginheight=0 scrolling=no>
<frame src="main.htm" name="main">
</frameset>
*************

here's nav.htm

<body background="" bgcolor="#000000" text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff">

<table width=100% border=0>
<tr align=center>
<td><a href="nav2.htm" target="nav2">Chatting</a></td>
<td><a href="nav3.htm" target="nav2">Moderators</a></td>
<td><a href="nav4.htm" target="nav2">Operators</a></td>
<td><a href="nav5.htm" target="nav2">Support</a></td>
</table>
</body>
*************

nav1.htm is a "blank" page as the "nav2" frame is supposed to be empty when the page is first hit

when you click on "chatting" in the nav (top) frame, "nav2.htm" should get loaded into the "nav2" frame


here's nav2.htm

<body background="" bgcolor="#00ff00" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" onload=parent.frames.main.location.href="starting.htm">
<center>
<table width=90% border=0>
<tr align=center>
<td><a href="starting.htm" target="main"><font size=-1>Getting Started</font></a></td>
<td><a href="chat.htm" target="main"><font size=-1>Chatting</font></a></td>
<td><a href="join.htm" target="main"><font size=-1>Joining a New Room</font></a></td>
<td><a href="bother.htm" target="main"><font size=-1>If Someone Bothers You</font></a></td>
<td><a href="nickreg.htm" target="main"><font size=-1>Own Your NickName</font></a></td>
</table>
</center>
</body>
*********

(there are other nav(some number).htm's, but if one gets fixed, they'll all get fixed.)

the problem is in the onload statement in nav2.htm --- it works *beautifully* with Netscape (3.04) -- but in IE (3.02) it craps out saying "in frame nav2 'main' is not an object"

now, I *have* to have this thing working perfectly with both Netscape & IE - and preferably with versions 3.x & 4.x of both.

I do *not* want some huge long javascript thing that's going to take up a jillion lines of code (besides the fact that I don't know javascript, so it would be rather difficult for me to decipher your instructions...)

Soo... can anyone fix my onload statement so that it works for both browsers?

(correct/working answer within 24 hours and I'll double the points :)

Nnickee
0
Comment
Question by:Nnickee
  • 4
  • 3
7 Comments
 
LVL 6

Accepted Solution

by:
Holger101497 earned 100 total points
Comment Utility
well... this answer seems so simple that it's hardly worth 200 points ;-))
I'm well ahead of the 24h deadline though ;-) (and I deserve the points for creating the files and installing IE3 just to check my answer *g*)

Here we go:
I am actually surprised that this works in Netscape! I have never seen this syntax before.
*** Instead of parent.frames.main you have to say parent.main ***

frames is normally an array that can be indexed by frames[0] or frames["name"]. Obviously Netscape is very forgiving and lets you access it as frames.name although it doesn't make so much sense ;-)
See? It's not jillions of lines, it actually makes it shorter! *g* Some other thing you can do to make it shorter is to eliminate the href - it is the default property of location. Your onload could therefore be: "top.main.location='starting.html'"

Good luck with your site! Let me know if there are still problems  with this (shouldn't ;-), I'll answer in 8 hours (after sleeping ;-)
0
 

Author Comment

by:Nnickee
Comment Utility
awesome!!!!

I just knew someone out there would be able to make it work :)

now.. *hopefully* the 4.x versions of the browsers haven't broken it :)

anyway, thanks a million.. and yes, it's still worth the 200 points *to me*

Nnickee

0
 

Author Comment

by:Nnickee
Comment Utility
Holger,

I swear to you.. I clicked on the "increase points to" and entered 200 in the box... somehow tho, it only awarded the original 100 pts for your answer (I still have 100 pts left, so I know it's not that I ran out of points) .. anyway, I've already left a note with customer service - if they don't fix this within the next day or so ... hmmm.. I guess I could always ask another question in here (like.. uhhhh.... "what does html stand for?" or something else really lame) and give you the other 100 pts for that one... I'm really sorry for the mixup, and I don't want you to think that I'm welshing on the deal... the answer is still worth 200 pts to me :)
Nnickee

0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 6

Expert Comment

by:Holger101497
Comment Utility
*laugh* - we're both pretty fast *g* - just saw your comment in customer service and wanted to add a "My respect! What an honest 'customer'!" *g*

As far as the 4.x versions are concerned: no, they haven't broken it *g* - as a thorough expert, I tested that before I posted the answer ,-)

So once again: Good luck with your site, looks pretty good so far (although I'm being cheated out of the content *g* - I'd also prefer a darker green *g*)
0
 

Author Comment

by:Nnickee
Comment Utility
Holger,

You are absolutely awesome :)  (you single?? j/k )

Isn't that green disgusting?!?  (it matches the logo tho, so what can I do?  I'm only writing the manual :)

you want content, huh?  leave me your email address, and as soon as we release this software, I'll drop you a line so you can grab a copy... and see all the wonderful content that you helped make possible :)

Nnickee
0
 
LVL 6

Expert Comment

by:Holger101497
Comment Utility
Me single - you Jane? I guess not *lol* ;-)

The site looks like a chat, so I guess the URL won't be a big secret? *g* Just post it here and I'll get an e-mail - I don't really want to post my address here. Maybe I'll take a look at the chat and find you? (same login?) Although it would of course be a competitor for a chat I'm currently developing a really really nifty JavaScript interface for *g* (500+ lines of code!) - maybe I can find some new ideas ;-)

About the green: well... I was trying to be diplomatic ;-)
About the points: whatever... as much as I'd like to have the points because they would finally put me into the toplist for this area, don't worry about it. I appreciate the effort! If customer service fixes it, great, if they don't, you can give me the exclusive rights to answer your next JavaScript-question ;-) As long as it is JS and there is an answer, I'll find it *g*

??? (ran out of good closing lines *g*) - have fun! Don't work too much! It's Sunday! (well.. as long as you're west of India :)
0
 

Author Comment

by:Nnickee
Comment Utility
Holger,

Too bad *grin*

Wow, you're smart... yes, it has to do with chat stuffies... and no, the site won't be a secret after we release (hopefully tomorrow :) ... so keep the "notify me when updated" on this question, and as soon as we release, I'll come back and post the url for ya (I'd do it now, except you went and told me that you're developing some competition, so now you're just gonna hafta wait the same as all our other competition to see it :)

(and no, *I'm* not programming it... I just test it and write the docs and will be doing tech support for it... so yes, once released and all, you'll be able to find me as "Nnickee" :)

customer service hasn't fixed the points thingy yet.... then again, it's only *barely* Monday now... I'll give 'em until midnight tonight, and if it still isn't fixed, I'll come back with another question for ya...

and yeah, I'm west of India... Texas, to be exact (yeeehaaawwww!)

cya in a couple days (prolly :)

Nnickee

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now