Forum OpenACS Q&A: Can anyone help where to place javascript in TCL file

Hai folks,
I wanna use javascript in my tcl code
where to put it ???
Givvme 1 example.

Ashwin

Ashwin Kumar,

It depends on what you want to do with the javascript.

To make the javascript availabe site-wide, place the .js files in the subsite resources dir:

service0/packages/acs-subsite/www/resources/

If you want to use javascript on a single page, add it to the header_stuff property tag in an adp page (the tcl file's complement in a tcl/adp file pair). Details here: https://openacs.org/forums/message-view?message_id=105849

If this is for special form validation, see the entire thread of that message.