onload statement on <body>

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

onload statement on <body>

Post by Pamb10 »

is it possible to add an onload statement to the <body> tag? I tried this, but it seemed to be removed when the project was built.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: onload statement on <body>

Post by LTinker68 »

That's because the body tag is replaced with the body tag from the masterpage file. If you want the onload statement on all topics, then apply it to the body tag on the masterpage you use for your topics. If you want that onload statement to be used with just one file (or a few), then the easiest thing to do is create a second masterpage, put the onload statement in the body tag on that masterpage, then associate that masterpage with the appropriate topic(s). (See this KB article for info on using multiple masterpages in projects --> http://kb.madcapsoftware.com/default_CSH.htm#FMP1001F.)
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: onload statement on <body>

Post by Pamb10 »

Thanks Lisa. Good idea. However the body tag got overwritten anyway as just <body>
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: onload statement on <body>

Post by LTinker68 »

What's the structure of the onload statement you're trying to add to the body tag?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: onload statement on <body>

Post by Pamb10 »

<body onload="resizeFrame(document.getElementById('childframe'))">

I have javascript code for the resizeFrame function

I also have an iframe that uses an id="childframe"
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: onload statement on <body>

Post by LTinker68 »

Hmmm. I tried it with a simple event to raise an alert message box, but that didn't work either. I could have sworn that used to work, but maybe not. Anyone else know how to get an onLoad event to work in WebHelp output?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: onload statement on <body>

Post by i-tietz »

I have sth like this in my masterpage and it works just fine:

Code: Select all

<head>
...
<script type="text/javascript">
            <!--
window.onload = ;
-->
</script>
...
</head>
You might have to rearrange the contents of the body tag, means: Call a function in the window.onload statement and add the function in that script section.
Inge____________________________
"I need input! - Have you got input?"
Pamb10
Sr. Propeller Head
Posts: 126
Joined: Wed Feb 01, 2006 2:08 pm
Location: Florida
Contact:

Re: onload statement on <body>

Post by Pamb10 »

Thank you for the suggestion. I will give it a try.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: onload statement on <body>

Post by i-tietz »

This should look like this:

Code: Select all

<head>
...
<script type="text/javascript">
            <!--
window.onload = resizeFrame();

function resizeFrame()
{
     obj = document.getElementById("childframe");

     ... your code here ... 

}
-->
</script>
...
</head>
Inge____________________________
"I need input! - Have you got input?"
Post Reply