Is it possible to create a file within the module directory that can be used to return Javascript output when called directly? I want this to be included in the module directory so all drupal sites can get this function. I would prefer not to create a node.tpl or page.tpl for every site.

Example: This link returns the Javascript to write out a node information to document.
www.site.com/modules/linkbutton/createlink.php?node=id

Suggestions?

Comments

vm’s picture

http://api.drupal.org/api/function/drupal_add_js/5 ??

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

phil88’s picture

So where would I include this javascript inline? node-linkbutton.tpl.php? Is there a way to avoid creating a node-tpl.php for this function and include this code output in the module?

This would also work with a creating an ASX video playlist for video content module.
Example:
http://www.site.com/modules/video/playlist.asx.

Suggestions?