Am I really the only one

T

Tery Griffin

who can't get onload to fire at all in IE on a Mac? I¹m about to try the
suggestion of adding the script after the body tag. I¹d really rather do it
some ³right² way, if there¹s a right way that works . . .

I have to admit that it¹s annoying to have to code around something that
doesn¹t work in a browser that¹s no longer being supported on the platform.
Unfortunately, we have a couple of labs full of Macs, and a lot of people
like to use IE on them.

Tery
 
L

Lee

Tery Griffin said:
this format, some or all of this message may not be legible.

--B_3165943671_121966
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: 8bit

who can't get onload to fire at all in IE on a Mac? I¹m about to try the
suggestion of adding the script after the body tag. I¹d really rather do it
some ³right² way, if there¹s a right way that works . . .

You've posted in MIME format to a text newsgroup and provided
a truly worthless subject line, and then continued your message
from the subject, so who knows what other sorts of mistakes you
might be making.
 
T

Tery Griffin

My sincerest and most humble apologies. I was unaware that Entourage posted
in MIME format. I guess I'll have to stop reading newsgroups with my e-mail
program -- no matter what it claims about its ability to handle them
properly.

I don't think the problem is mistakes in the code. At least, no one here or
on the IE/Mac group can find any. It just seems so unlikely that onload
wouldn't work -- it's not exactly an esoteric command. I figured if IE is
truly unhappy with onload, someone somewhere might have found a "legal"
workaround.

Back to the drawing board. But thanks so much for your assistance, Lee!

Tery
 
T

Tery Griffin

You are not even doing anything with the onLoad handler.

<BODY onLoad="code();">


Brian


Hi Brian,

That can't be true, since it works in Safari and Netscape, and in IE on
Windows. The only problem is with IE on Macs.

All I want it to do is this: when the page loads (it's actually in a frame),
run a Perl script that selects a random image and generates HTML to run a
Flash program in that frame. The Flash fades in the image and puts some
scrolling text across it.

The onload on this page should be invoking the Javascript in the header.
True, all that Javascript does is submit a form -- which starts the Perl
program running. Except that, in IE/Mac only, the form doesn't get
submitted. I've check the IE settings (that Javascript can run, etc.) and
had other people try it. The results are consistent -- fine elsewhere,
nothing on IE/Mac. I hate to scratch the whole design because of a browser
problem.

Tery
 
B

Brian Genisio

Tery said:
Hi Brian,

That can't be true, since it works in Safari and Netscape, and in IE on
Windows. The only problem is with IE on Macs.

All I want it to do is this: when the page loads (it's actually in a frame),
run a Perl script that selects a random image and generates HTML to run a
Flash program in that frame. The Flash fades in the image and puts some
scrolling text across it.

The onload on this page should be invoking the Javascript in the header.
True, all that Javascript does is submit a form -- which starts the Perl
program running. Except that, in IE/Mac only, the form doesn't get
submitted. I've check the IE settings (that Javascript can run, etc.) and
had other people try it. The results are consistent -- fine elsewhere,
nothing on IE/Mac. I hate to scratch the whole design because of a browser
problem.

Tery

This is the code for your page. There are no frames, and there are no
onLoad handlers. In fact, there is no Javascript on this page.

If the code you are talking about is on a different page, you need to
provide a link to the page in question.

Brian

--

<html>
<head>
<title>comm test</title>
</head>

<body bgcolor="#330099" >

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="665" height="340" id="randomtext" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie"
value="randomtext.swf?imgsrc=homeimages/w_maclab_3.jpg&" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#330099" />
<embed src="randomtext.swf?imgsrc=homeimages/w_maclab_3.jpg&"
menu="false" quality="high" bgcolor="#330099" width="665" height="340"
name="randomtext" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>


</body>
</html>
 
L

Lee

Tery Griffin said:
My sincerest and most humble apologies. I was unaware that Entourage posted
in MIME format. I guess I'll have to stop reading newsgroups with my e-mail
program -- no matter what it claims about its ability to handle them
properly.

I don't think the problem is mistakes in the code. At least, no one here or
on the IE/Mac group can find any. It just seems so unlikely that onload
wouldn't work -- it's not exactly an esoteric command. I figured if IE is
truly unhappy with onload, someone somewhere might have found a "legal"
workaround.

Back to the drawing board. But thanks so much for your assistance, Lee!

You haven't posted your code. At least, not in this thread,
so I only have your assertion that nobody can find a problem
in your code. How can you expect any real help?
 
L

Lee

Tery Griffin said:

The actual code for the page in question seems to be:

<html>
<head>
<title>comm test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript" type="text/javascript">
function submitform()
{
document.form.submit();
}
</SCRIPT>


</head>

<body bgcolor="#330099" onload="submitform()">

<form name="form" action="randomimages_2.pl">
</form>
</body>
</html>


Automatically submitting a form is not a reasonable way
to redirect to your second page. It would be much simpler
to change the value of the location attribute or use HTTP
headers to redirect, and much more robust to simply replace
the page on the server.
 
T

Tery Griffin

This is the code for your page. There are no frames, and there are no
onLoad handlers. In fact, there is no Javascript on this page.

If the code you are talking about is on a different page, you need to
provide a link to the page in question.

Brian

--

<html>
<head>
<title>comm test</title>
</head>

<body bgcolor="#330099" >

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=5,0,0,0"
width="665" height="340" id="randomtext" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie"
value="randomtext.swf?imgsrc=homeimages/w_maclab_3.jpg&" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#330099" />
<embed src="randomtext.swf?imgsrc=homeimages/w_maclab_3.jpg&"
menu="false" quality="high" bgcolor="#330099" width="665" height="340"
name="randomtext" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>


</body>
</html>



Wow -- that's the code generated by Perl program triggered by the form
submission. That's not at all what happens when I try this on IE/Mac. I
get nothing but a blank blue screen. View/source shows me:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>comm test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<SCRIPT language="JavaScript" type="text/javascript">
function submitform()
{
document.form.submit();
}
</SCRIPT>

</head>

<body bgcolor="#330099" onload="submitform()">
<form name="form" action="randomimages_2.pl">
</form>
</body>
</html>



which is the code on the page that's supposed to trigger the onload.

I know it's not in a frame here, btw. I didn't send you the frameset
address because then you'd just have to hunt down the URL for the code in
that frame anyway. The frameset is at:
http://www.wsc.ma.edu/webstudents/commWebSite/commSite_frameset.htm .

I'm on OS X 2.8 using IE 5.2.2. The same thing that happens to me happens
to a colleague on OS 9 with the latest version of IE for OS 9. It also
happens on all our lab machines, which are OS X 3 -- the images and
scrolling text just don't load. Running the Perl script directly
(http://www.wsc.ma.edu/webstudents/commWebSite/randomimages_2.pl ) works
fine, even in IE.

What the?????

Tery
 
T

Tery Griffin

.

I don't see any onLoad event in that page at all.

onLoad definitely fires on IE on Mac.
http://www.mattkruse.com/temp/onload.html
works fine for me using IE on a Mac.

That works for me, too. I noticed that I didn't have a semi-colon:
<body onLoad="alert('success');">
vs:
<body onLoad="submitform()">

so I just added it. Now I get just a white screen in IE.

Another difference is that you're issuing a Javascript command directly
where I'm trying to trigger some Javascript in the HEAD of the HTML doc. I
wonder if that could be doing it . . .

Tery
 
B

Brian Genisio

Tery Griffin wrote:

which is the code on the page that's supposed to trigger the onload.

I know it's not in a frame here, btw. I didn't send you the frameset
address because then you'd just have to hunt down the URL for the code in
that frame anyway. The frameset is at:
http://www.wsc.ma.edu/webstudents/commWebSite/commSite_frameset.htm .

I'm on OS X 2.8 using IE 5.2.2. The same thing that happens to me happens
to a colleague on OS 9 with the latest version of IE for OS 9. It also
happens on all our lab machines, which are OS X 3 -- the images and
scrolling text just don't load. Running the Perl script directly
(http://www.wsc.ma.edu/webstudents/commWebSite/randomimages_2.pl ) works
fine, even in IE.

What the?????

Tery

Maybe, the onLoad is being called, but nothing is being sent, because
you have no form inputs? You dont specify a method? (Wild-ass-guesses)
I dont have IE/Mac, so I cant test it out for sure.

But, my question is this... why are you doing it this way? Wy not do:

document.location = "randomimages_2.pl"

If you are not sending any paramaters, why use a form? If you are
hard-coding the inputs, why use a form? A form only makes sense if you
want user input.

Brian
 
R

Robert

Lee said:
Tery Griffin said:

The actual code for the page in question seems to be:

Actually, I copyied this link in to Netscape 7.1 and IE. 5.2.1 on
MacOS 10.2.8 and I got a random set of images when I created a new
window and did the pastes.
http://www.wsc.ma.edu/webstudents/CommWebSite/randomimages_2.pl?1234567

I added the numbers 1234567 just to see if it worked with the numbers
following.

Now, back to the original HTM file...

The problem seems to be that the form didn't contain a submit button.

I got this script to work in IE 5.2.1 and Netscape 7.1 on MacOS
10.2.8:

<html>
<head>
<title>redirection test</title>

<style type="text/css">
..hiddenStyle {position:relative; visibility:hidden;}
</style>

<SCRIPT language="JavaScript">
function submitform()
{
alert("in function submitform");
document.form.submit();
}
</SCRIPT>

</head>

<body onload="alert('in onload');submitform();">

<p>Hide the form so we do not see the submit button.</p>

<div id="formNotThere"

class="hiddenStyle">

<form name="form"
action=
"http://www.wsc.ma.edu/webstudents/CommWebSite/randomimages_2.pl">

<input type="submit" value="Submit form">

</form>
</div>

<p>Seems IE on the Mac expects a submit tag. Makes sense, if you
think about it.</p>
<p>I left the alerts in, so we can see what is going on.</p>
</body>
</html>
 
T

Tery Griffin

Thank you! You're right -- it does make sense. I made several changes that
people here suggested. The only one that worked was skipping the html
entirely and loading the perl program directly into that frame. That throws
a blank screen up once in a while, though.

If I can't figure out what's causing the blank screen, I'll try this
approach. I'm glad not to have to abandon the design.

Thanks to everyone for the help.

Tery
 
B

Brian Genisio

Robert said:
Actually, I copyied this link in to Netscape 7.1 and IE. 5.2.1 on
MacOS 10.2.8 and I got a random set of images when I created a new
window and did the pastes.
http://www.wsc.ma.edu/webstudents/CommWebSite/randomimages_2.pl?1234567

I added the numbers 1234567 just to see if it worked with the numbers
following.

Now, back to the original HTM file...

The problem seems to be that the form didn't contain a submit button.

I got this script to work in IE 5.2.1 and Netscape 7.1 on MacOS
10.2.8:

<html>
<head>
<title>redirection test</title>

<style type="text/css">
.hiddenStyle {position:relative; visibility:hidden;}
</style>

<SCRIPT language="JavaScript">
function submitform()
{
alert("in function submitform");
document.form.submit();
}
</SCRIPT>

</head>

<body onload="alert('in onload');submitform();">

<p>Hide the form so we do not see the submit button.</p>

<div id="formNotThere"

class="hiddenStyle">

<form name="form"
action=
"http://www.wsc.ma.edu/webstudents/CommWebSite/randomimages_2.pl">

<input type="submit" value="Submit form">

</form>
</div>

<p>Seems IE on the Mac expects a submit tag. Makes sense, if you
think about it.</p>
<p>I left the alerts in, so we can see what is going on.</p>
</body>
</html>

Wow. Why in the world are you doing it this way? This is the most
convoluted way of redirecting I have seen yet. It is like a Rube
Goldberg machine (www.rube-goldberg.com). I know you have been working
a while to get this working properly, but you really should just scrap
it, and use a better method.

If you need a redirect, why dont you just do this?

<HTML><HEAD><SCRIPT>document.location =
"http://www.wsc.ma.edu/webstudents/CommWebSite/randomimages_2.pl"</SCRIPT></HEAD></HTML>

Or use a META refresth tag in the head... it doesnt even require Javascript:

<meta http-equiv="refresh"
content="1;url=http://www.wsc.ma.edu/webstudents/CommWebSite/randomimages_2.pl">

If you really want it to work, use both... but there is no reason at all
to redirect the way you are. What if the user doesnt even have
Javascript enabled?

Another solution without requiring Javascript, is to use a single frame
that takes up all of the browser window:

<frameset border=0 rows="100%,*" frameborder="no" marginleft=0
margintop=0 marginright=0 marginbottom=0>
<frame
src="http://www.wsc.ma.edu/webstudents/CommWebSite/randomimages_2.pl"
scrolling=auto frameborder="no" border=0 noresize>
<frame topmargin="0" marginwidth=0 scrolling=no marginheight=0
frameborder="no" border=0 noresize>
</frameset>

This method, of course, will not change the actual location, which is OK
if you like the looks of the first URL better than the second. It is
used in domain redirecting all the time. For instance, my website,
brian.genisio.org goes to a funny domain server that uses the mentioned
code to take me to my university site. The university site URL is
messy, so I use this method, and the user always seed brian.genisio.org
as the URL.

Brian
 
T

Thomas 'PointedEars' Lahn

Matt said:
Try removing the doctype and see what happens.

What happens is that it becomes invalid and
thus less interoperable content, if that.


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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top