Javascript in Header

Ewgenij Sokolovski April 2, 2014

Hello, community. I found out that if I define Javascript functions in the header <head></head>, they can't be accessed in the body. What is the reason for that kind of behaviour??? Strange is also that it does work in preview but not in the saved page.

For embedding HTML and Javascript I use the HTML Macro of Confluence.

Best regards

Ewgenij

1 answer

0 votes
Luther Hargrove
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 2, 2014

Just include it in the body somewhere. If you must include it in the header, then wrap a function around it and then call the function in the body somewhere. Might as well just put it in the body if that is the case though.

Ewgenij Sokolovski April 3, 2014

Hello, but why is it not possible to define functions in the header like you do it usually? And as I said if I define functions in the header, I'm not able to access them in the body!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events