Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2005-11-11 13:45:36

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Standard location for plugin support files

Call your javascript using <script src="index.php?js=jspop" type="text/javascript"></script> the parameter doesn’t have to be js that’s just what I use. Then in your plugin add something like.

<code>
if (gps(‘js’) == ‘jspop’) { header(‘Content-type: application/x-javascript’); //Do stuff exit(0); }
</code>
p. I would recommend adding your plugin author prefix (like hak_jspop) to the variable you are checking for just to prevent collision problems.


Shoving is the answer – pusher robot

Offline

#17 2005-11-13 20:21:40

1beb
Plugin Author
From: Canada, Ontario, Toronto
Registered: 2004-11-22
Posts: 169
Website

Re: Standard location for plugin support files

Is there any way to use js, only on pages that include a call to a particular plugin that actually uses it? And how would that be accomplished in terms of code in the plugin?

Offline

Board footer

Powered by FluxBB