1. 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

Discussion in 'Closed Suggestions' started by Cory Booth, Aug 12, 2010.

  1. Cory Booth

    Cory Booth Well-Known Member

    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.
     
  2. Shadow

    Shadow Member

    I like that idea, if a particular file isn't needed, then why should it be loaded?
     
  3. Cezz

    Cezz Well-Known Member

    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.
     
  4. Cory Booth

    Cory Booth Well-Known Member

    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)
     
  5. Cezz

    Cezz Well-Known Member

    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.
     
  6. Brandon_R

    Brandon_R Guest

    There is a function to lazy load javascript and css, if that's what you wanted?
     
  7. Cory Booth

    Cory Booth Well-Known Member

    I was looking for something that:
    1. I didn't have to edit templates
    2. It loads when needed

    Not sure what lazy load is.
     

Share This Page