Content last modified Monday 6 March 2017
hop to #bottom
Stanislav Müller
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 6 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


Stores JavaScript files within the database and handles them similar to CSS files.

In admin section, go to tab “presentation > javascript” and create one ore more javascript files that you want to embed within your page templates. This is similiar to the “styles” tab – the JavaScript files get stored in the database and you can embed them with a new Textpattern tag:

<txp:js /> (embeds default JavaScript file)
<txp:js n="myDomScript" /> (embeds JavaScript file named "myDomScript")

<script type="text/javascript" src=""></script>

PS: if you have got some bugs, just drop me a mail

Article Request Count:
Initially released:
Posted here:
30 Nov 2006
Article modified:
27 May 2010

Comments/questions? Leave a message in the form.

Commenting is closed for this article.

Commented (22)


Great news Exactly what I’ve wanted for quite some time

Thank You.

doens’t work for me — using it on txp 4.0.4, and all it does is cause a bunch of PHP parse errors on the presentation > javascript page. My only other plug-in is a captcha one.

I tested it as well, unfortunately it’s not working in version 4.0.4

Any chance someone can update this to work? It seems like a rather gaping hole in the textpattern system, and I’d love to start updating my sites with better JS support.

Download link is broken. I just get a blank file.


Seems to work fine for me in 4.0.4 – great plugin.

Download link doesn’t work!

i have a problem with this one too… The site resides in a sub directory and the plugin’s output is:
as oposed to
the first does not fetch the js file…

@colak: change the url in the plugin’s source;
hacking isn’t bad ;)

This is just waht i wanted

@Stanislav Müller
I’ve edited the plugin. Only mentioned it here to alert the developer and other users re this.


Most bizarre – after posting above that I had no problems installing on one site (with about twenty existing plugins), I’ve now tried to install it on an almost vanilla 4.0.4 installation, and I’ve got the parse errors mentioned earlier:

Warning: Table ‘photohst_one.txp_txp_js’ doesn’t exist select count(*) from txp_txp_js as txp_js where name=‘default’ in /data01/photohst/public_html/textpattern/lib/txplib_db.php on line 84

there is problem with this plugin when you use db prefix, change the name of table and everything will be ok

updated to version 0.2. Prefix bug is fixed i think?!

excelent time of reaction :)
it seems, that everything work fine now, even with prefixes.

The functions inside this plugin should be prefixed with the plugin author prefix to avoid namespace conflicts (js -> stm_js).

@Ruud van Melick: why do think so?


Does this plugin work with version 4.0.6?

If so, why don’t I see the new tab “Javascript” when I select “Presentation” in the admin area?

Matt Lockwood:

I don’t see the Javascript tab either. Is there something else to install?


Yeah, I don’t see a “Javascript” tab in 4.0.6 either.

@all, sorry for waiting. Bug is fixed now and tested with version 4.0.6.

- Best

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment?

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern