5

I have created Gui Extension and I use jQuery in command javascript. I have $j selector instead of $. It works in three environment but doesn't work in one (the 4th). I have the following error

ReferenceError: $j is not defined

I didn't explicitly reference jquery in my Gui Extension. This is what I have in my config:

<resources cache="true">
<cfg:filters/>
<cfg:groups>
  <cfg:group name="Archive.ConfigSet" merger="Tridion.Web.UI.Core.Configuration.Resources.CommandGroupProcessor" merge="always">
    <cfg:fileset>
      <cfg:file type="style">{ThemePath}/Archiving.css</cfg:file>
      <cfg:file type="script">/Commands/ArchiveCommand.js</cfg:file>
      <cfg:file type="reference">Archive.Interface</cfg:file>
      <cfg:file type="script">/Users.js</cfg:file>
    </cfg:fileset>
    <cfg:dependencies>
      <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
    </cfg:dependencies>
  </cfg:group>
  <cfg:group name="Unarchive.ConfigSet" merger="Tridion.Web.UI.Core.Configuration.Resources.CommandGroupProcessor" merge="always">
    <cfg:fileset>
      <cfg:file type="style">{ThemePath}/Archiving.css</cfg:file>
      <cfg:file type="script">/Commands/UnarchiveCommand.js</cfg:file>
      <cfg:file type="reference">Unarchive.Interface</cfg:file>
      <cfg:file type="script">/Users.js</cfg:file>
    </cfg:fileset>
    <cfg:dependencies>
      <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
    </cfg:dependencies>
  </cfg:group>
</cfg:groups>

I have tried to add jquery.js to this config (based on this article) but I got exception that item with same id is already added.

I cannot find differences between environment. Do you have any idea what could be the problem?

5
  • When you say it doesn't work, what do you mean exactly? What kind of error do you get? Commented Mar 31, 2017 at 13:20
  • 1
    _ReferenceError: $j is not defined_ I tried with '$' and with 'jQuery()' and it didn't work. I could try to add reference for jquery in GUI Extension but than I will not have consistent state in all environment. I already have tried to add reference to Gui extension on other environment but jQuery was already included so it made a conflicts.
    – aleksandar
    Commented Mar 31, 2017 at 13:31
  • 1
    Is it possible jQuery is not included in the 4th environment? Is there another extension which adds jQuery which is not installed? Commented Apr 2, 2017 at 11:56
  • Also - please update your question with the error message in your comment. Commented Apr 2, 2017 at 11:56
  • 1
    I found what was the problem. There was one extension that includes jquery in the first three enviroment. That was the reason why there wasn't jquery available on the 4th enviroment. Thank you for the help. You can move your comment as an answer so I can accept it.
    – aleksandar
    Commented Apr 3, 2017 at 13:01

1 Answer 1

4

As I suggested in the comments - it sounds like there is another extension which adds jQuery which was not installed on your 4th environment.

Glad your problem is resolved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.