The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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!

TAGS
AUG Leaders

Atlassian Community Events