onload statement on <body>
onload statement on <body>
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.
Pam Brechlin
Freelance Technical Writer
http://www.pambrechlin.com
http://www.linkedin.com/in/pambrechlin
Freelance Technical Writer
http://www.pambrechlin.com
http://www.linkedin.com/in/pambrechlin
Re: onload statement on <body>
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.)
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: onload statement on <body>
Thanks Lisa. Good idea. However the body tag got overwritten anyway as just <body>
Pam Brechlin
Freelance Technical Writer
http://www.pambrechlin.com
http://www.linkedin.com/in/pambrechlin
Freelance Technical Writer
http://www.pambrechlin.com
http://www.linkedin.com/in/pambrechlin
Re: onload statement on <body>
What's the structure of the onload statement you're trying to add to the body tag?
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: onload statement on <body>
<body onload="resizeFrame(document.getElementById('childframe'))">
I have javascript code for the resizeFrame function
I also have an iframe that uses an id="childframe"
I have javascript code for the resizeFrame function
I also have an iframe that uses an id="childframe"
Pam Brechlin
Freelance Technical Writer
http://www.pambrechlin.com
http://www.linkedin.com/in/pambrechlin
Freelance Technical Writer
http://www.pambrechlin.com
http://www.linkedin.com/in/pambrechlin
Re: onload statement on <body>
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?
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: onload statement on <body>
I have sth like this in my masterpage and it works just fine:
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.
Code: Select all
<head>
...
<script type="text/javascript">
<!--
window.onload = ;
-->
</script>
...
</head>Inge____________________________
"I need input! - Have you got input?"
"I need input! - Have you got input?"
Re: onload statement on <body>
Thank you for the suggestion. I will give it a try.
Pam Brechlin
Freelance Technical Writer
http://www.pambrechlin.com
http://www.linkedin.com/in/pambrechlin
Freelance Technical Writer
http://www.pambrechlin.com
http://www.linkedin.com/in/pambrechlin
Re: onload statement on <body>
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?"
"I need input! - Have you got input?"