Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
external js
rodigz
Hi,
I'm trying to call my javascript files in one workarea which will be use in all the branhces that I have. All my javascript files will be in one workarea in such a way I can recyle my javascript. What will be the correct path?
I've tried this one. It's not working.
<script language="javascript" location="template-type" src="/iwmnt/default/main/GlobalSources/AboutPrint/WORKAREA/temp_workarea/maxcharacter.js">
thanks!
Find more posts tagged with
Comments
Migrateduser
I usually put the JavaScript in IWHOME/httpd/iw/custom, then reference it as just /iw/custom/functions.js or whatever.
If you absolutely need it to be in the workarea I think the path starts with /iw-mount.
Adam Stoller
From the FormAPI documentation:
The value of the location attribute controls how the src attribute is interpreted:
'webserver'
The src attribute is simply the URL of the target, for example
http://myserver/mypath/hello.js
. This is the default if the location attribute isn't specified.
'template-type'
In this case, src specifies a location relative to the template type directory. So if 'hello.js' lived alongside the DCT in:
'/iwmnt/default/main/WORKAREA/user/templatedata/category/type/hello.js'
then simply specifying 'src="hello.js"' would be sufficient.
Note that you can use the webserver location type to access content that is on the same TeamSite server but in a different location than the template type directory by using the '/iw-mount' URL prefix:
<script src="/iw-mount/default/main/SomeBranch/EDITION/SomeEdition/SomeDirectory/hello.js"/>
Hope that helps.
--fish
(Interwoven Senior Technical Consultant)
Michael
Hi
Using the script tag with location="webserver" I am able to access the JavaScript from iw-home/httpd/iw/... with src="/iw/..."
I would prefer to put my JavaScript under iw-bin instead of iw. However I can't seem to access the JavaScript if it is in src="/iw-bin/..." . Has anyone else managed to do this? Is there something special about the iw directory?
Thanks for your help.
Cheers
Michael
TS 6.0 + jumbo, W2K SP3.
JonathonG
"iw-bin" is considered a cgi directory by the apache instance. As such, it tries to execute any references from there, as opposed to just retrieving them. So, what's happening when you reference /iw-bin/mycode.js is that apache tries to execute it, and nothing is written to STDOUT, so nothing is returned to the brower.
Does that make sense?
Jonathon
Independent Interwoven Contractor
Michael
That does make sense -- thanks for explaining!
Migrateduser
I would avoid putting anything other than CGIs in iw-bin - is the reason you want it there just because you want to keep all the customizations in one place?