does jQuery work in Lectora v17.1.1?

prg1792 Community Member Posts: 43 ♪ Opening Act ♪
Not even sure how to fully explain this, but I cannot get jQuery code to work in v17.1.1. Has anyone else been able to?

I have a title that I built in v17.0.6 that includes the jquery-1.11.1.min.js library and some simple code on each page (at the title level). Now published in 17.1.1, each page fails on the first jQuery statement, $(document).ready, which throws an "object expected" error.

After some searches, I read that this may be caused by a jQuery.noConflict(). Sure enough, the latest version of trivantis.js has a line "if (window.jQuery) triv$ = jQuery.noConflict(true)", which is executed on every page. I tried replacing "$" in my code with "triv$" - this eliminates the error but does not execute the code.

I also noticed:
  • Pages with the default media player now have jquery-1.10.2.min.js included.
  • triv$ is used in trivantis.js and in trivantis-media.js.
Has anyone successfully added jQuery code to v17.1.1?


  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    I have deliberately not upgraded to v17.1.1 because of the many issues i read here with it. Still at  v17.0.6, and do think that was wise...
  • carlfink
    carlfink Community Member Posts: 971 ✭ Legend ✭
    You can edit Trivantis.js if want and just remove that test ....
  • timk
    timk Community Member Posts: 1,207 ♦ Idol ♦
    You can "Run javascript" on title level:

    $ = triv$.noConflict();

  • prg1792
    prg1792 Community Member Posts: 43 ♪ Opening Act ♪
    @TimK, Thanks, that works!

    @CarlFink, I tried that but got errors loading pages that have the media player.

    @Math, I was hoping 17.1.1 would resolve some issues I have in 17.0.6, but like many, I have found more issues instead of less. I'm writing jQuery code to see if i can resolve some of the issues I'm running into.