Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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?
Proud Canadian. Toronto Locksmith , Actualize Consulting
Offline