View Full Version : Java Script Onload Event Handler Problem
I am using the Geo Cities Page Builder for my web site, and used the Age Finder Script. Everything works fine, except that the onload event handler script that goes into the Body Tag shows on the page when it is viewed in the browser. :rolleyes: What am I doing wrong? Here is the script for the Body Tag: <BODY OnLoad="startclock()">
Hope someone can help!
Thanks so much!
TemperedSteel
08-17-2002, 06:46 PM
what is the web address of that site, if you give me that, I acn look, it most likely isn't the code but an error on the page.
:o Thanks for such a quick reply! Here is the URL for you to take a look at: [URL=http://www.redladyrailers.com/Membership.html]
I really appreciate the help!
TemperedSteel
08-17-2002, 07:10 PM
yeah I was right
the code that is there is:
<body background="http://www.redladyrailers.com/B1db.jpg" bgcolor="#FFFFFF" link="#9A3E5F" vlink="#9A3E5F" text="#9A3E5F" <BODY OnLoad="startclock()">
onLoad="window.onresize=new Function('if (navigator.appVersion==\'Netscape\') history.go(0); else center();'); center();">
and it should be somthing like:
<body background="http://www.redladyrailers.com/B1db.jpg" bgcolor="#FFFFFF" link="#9A3E5F" vlink="#9A3E5F" text="#9A3E5F" OnLoad="startclock();window.onresize=new Function('if (navigator.appVersion==\'Netscape\') history.go(0); else center();'); center();">
and that should do it.
Graeme Hackston
08-17-2002, 07:10 PM
You have more than one <head> </head> and <body> tags. The 2nd body tag is being written to the page.
:( I have tried everything, but the script still shows up on the screen! In Geo Cities Page Builder, You have to go to Advanced Properties and put the onload event handler in the body script tag, and that is when it shows up on the screen.
If I put the script into the body where you insert scripts, I get a message that I need a browser that supports Java 1.1. When I put the script into the Advanced Properties body tag, it works fine! Maybe I've been playing with it for so long that I'm just not seeing the obvious!
Would it help if I sent the whole code for Age Finder, so you can see it?
Thanks again!
redhead
08-17-2002, 09:05 PM
ok... open up notepad and load your page into it.
then take a look at this line:
<body background="http://www.redladyrailers.com/B1db.jpg" bgcolor="#FFFFFF" link="#9A3E5F" vlink="#9A3E5F" text="#9A3E5F" <BODY OnLoad="startclock()"> onLoad="window.onresize=new Function('if (navigator.appVersion==\'Netscape\') history.go(0); else center();'); center();">
see how it ends the tag and then doesnt even try to start it?
make it more like this:
<body background="http://www.redladyrailers.com/B1db.jpg" bgcolor="#FFFFFF" link="#9A3E5F" vlink="#9A3E5F" text="#9A3E5F" OnLoad="startclock(); window.onresize=new Function('if (navigator.appVersion==\'Netscape\') history.go(0); else center();'); center();">
That should solve it.
:thumbsup:
:thumbsup: Thanks everyone for all of your help! However I never could get to work, so I found another "age finder" that was much easier to install, plus I like it a lot better!
Hope everyone has a great day:)
Sara
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.