• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Javascript Includes

Cory Booth

Well-known member
#1
I was thinking,

It would be nice to have an area to designate specific javascript you would want loaded - and then specifiy what page or even what module you want the javascript loaded with.

Say an area in admin:
File: somejava.js
Page: index.php

File: someotherjava.js
Page: members.php

etc...

This could cut down some of the edits to templates to accomidate add-ons and also cut down on javascripts for those pages that don't need it - as many folks just put all the javascript calls in the footer or something and it loads on every page.
 

Cezz

Well-known member
#3
As long as addon's can add the JS via a PHP call it won't be a problem...

So to take an example from modx CMS

Code:
$modx->regClientJS('http://somedomain.com/somejsfile.js');
Would automatically add the JS to the header when it is called by the plugin.
 

Cory Booth

Well-known member
#4
As long as addon's can add the JS via a PHP call it won't be a problem...

So to take an example from modx CMS

Code:
$modx->regClientJS('http://somedomain.com/somejsfile.js');
Would automatically add the JS to the header when it is called by the plugin.
I'm not familiar with Modx - but yeah, that is pretty much what I am saying.
Right now with VB I am including java with plugins:
1 so I don't have to reedit templates and
2 so I can control when they load (i.e. this_script = blah blah)
 

Cezz

Well-known member
#5
I'm not familiar with Modx - but yeah, that is pretty much what I am saying.
Right now with VB I am including java with plugins:
1 so I don't have to reedit templates and
2 so I can control when they load (i.e. this_script = blah blah)
Modx has been my full featured CMS of choice for a while, it is very powerful and can also be really easy to use as an application framework as well for quick deployment... The latest codebase is very much MVC like xenForo.