• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 how do I add some Javascript to a template file?

zoldos

Well-known member
#1
I want to put this in my template's header:

Code:
function popjack3()
 {
window.open('./cometchat/modules/chatrooms/index.php','popjack3','width=700,height=500,screenX=300,screenY=175');
 }
Is it just straight like that? Or is it done differently? Thanks!
 

Brogan

XenForo moderator
Staff member
#2
Where can additional JavaScript be placed?
Additional JavaScript can be placed in the PAGE_CONTAINER, page_container_js_head or page_container_js_body templates. If PAGE_CONTAINER is used, it can be placed anywhere in the template. If page_container_js_head is used, it will be included in the head section of PAGE_CONTAINER. If page_container_js_body is used, it will be included in the body section of PAGE_CONTAINER, after the footer. It depends on the JavaScript to a large extent; some require to be placed in the head, some in the body.

http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-181112