PDA

View Full Version : Javascript in <head>


JeremyDeal
11-28-2005, 10:07 PM
I am simply amazed at UltraGuest and its features, ease of use & reliability. Probably the best free "anything" Ive ever come across, and I spread the news to everyone I know. Thank you for giving the on-line community something to get excited about! I have figured out how to add a body "onload" javascript event, but I need help for this one...

My question: I have the following Javascript which I desperately need to use between the <head> and </head> tags of my guestbook, can anyone help:

<script type="text/javascript">
function goSetHeight() {
if (parent == window) return;
else parent.setIframeHeight('iframe');
}
</script>

Andreas
11-28-2005, 11:03 PM
Thanks :) Your website looks awesome by the way!

Any chance that the javascript would work if it was called from somewhere outside the <head> tags? If that's the case you can add it to the "header" of your guestbook. If that's not possible, let me know and we'll work out another solution.

JeremyDeal
11-29-2005, 08:02 AM
Thanks for the compliment and quick response! :D Next time you visit my website, please feel free to sign my guestbook made possible by UltraGuest! :cool:

My Long Winded Explination: This particular code has two parts to it. The part Ive having probblems with needs to be in the head to work properly because it is a called function that resizes the iframe height to fit the guestbook depending on how long the guestbook is, this can only be done after comparing the parent height value with the iframe after it is loaded. Once the value of the parent is established an onload event is called from the guestbook body tag (ie: <body onload='goSetHeight()') thus running the script in the head. That is the only way the code can adjust the window size accordingly with cross-browser compatibility.

Suggestions? Maybe something like an editable head section or "Attach javascript" button on the Guestbook Settings page? Can you help, it would be greatly appreciated?

Andreas
11-29-2005, 08:23 AM
I've added the header to your guestbook manually for now. I'll let you know once this feature is ready.

Let me know if this does not work...

Good luck!

JeremyDeal
11-29-2005, 08:40 AM
Man your Customer Support is Awesome! :cool: Only one probblem... wrong guestbook :eek:. I didnt know you were going to actually put the code in for me (I never expected that level of support!!!). Here is the guestbook it needs to be in (you should also see my <body> tag modification - :) ). http://www.ultraguest.com/?id=1107980438 (http://www.ultraguest.com/?id=1107980438)

Here is the pro-bono website (currently in development) I am using it on: http://www.rccog.org (http://www.rccog.org), there you can see the code in action on all the other pages and why I need it added to the guestbook. Thanks!

Andreas
11-29-2005, 08:56 AM
See if it works now! :)

JeremyDeal
11-29-2005, 09:22 AM
Thank you, I wont bug you any more! Ill wait untill you add the feature! :D