Forum - Primo: How to use multiple JavaScript files?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #35250

    I’m new to Primo and want to know that how can I include multiple JavaScript files in Primo? For eg. custom.js and custom2.js. If that’s possible, where can I include the js filename through Primo Admin Panel or any other possible way.


    Dont think by default you can. But you may include/import if needed.

    Primo only looks at and use custom.js.

    However, if you are using the Primo development environment, you can split your js into separate files. When you run gulp, it will merge all js files found under the js folder (excluding subdirectores) into one custom.js file. Rest of them will remain intacted. If you want to include addtional js files to be used, you can create a subfolder inside the js folder and put them in there. They will not be merged into custom.js.


    Solent University 44SSU_INST

    I haven’t been able to get import to work. Is there anyone who has done this who can share their code?

    Paul Madley

    I can’t recall where I got this from, or who AFD is, other than part of the WHELF consortium. Which I’ll address before we go live. Anyhoo…

    /**Load the Javascript file used for the rotating images on the Primo home page – AFD 29-08-2018**/
    var s = document.createElement(‘script’); = ‘localScript’;
    s.src = ‘THE URL OF YOUR CODE HERE’;

    Paul Madley

    As Kevin says though, Gulp will get involved and try to put the files together in the dev environment. We use SVN so I simply remove the offending file (custom.js) and then do an SVN update. This is on our own dedicated dev server btw.

    Wai-yan NG (The Open University of Hong Kong)

    Try this:

    app.controller(‘someController’, [‘angularLoad’, function (angularLoad) {

    Antrez R

    would you have an example of running/calling JS function into custom.js? Set any time out?

    • This reply was modified 6 months, 4 weeks ago by Antrez R.
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.