Explore the community Forums Lectora Online Lectora Online Questions & Answers Javascript from an imported package

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #300856 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    Hi,

    I made a L11 with quite some Javascript. In preview mode and published as html in L11 it works as expected. Now exported that title as package. Next step importing it in L12 online. All the assets, graphics groups and actions, including the additional JS-files are all nicely added. But the javascript doesnot work??

    Anyone any clues to what i might be missing ?

    #300883 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    336 pts
    @ssneg

    How is the JS executed? If it is run via “Run JS” actions, check if actions are there after import. If it is included via external HTML objects, check if the objects are there after import.

    #300895 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    Hi sergey, both are used.  Actions are properly present. All imported js libraries too… The scripts themselves are fine too… Only thing different is that in L11 i use ‘Custom div’ and that gets converted to ‘other’ ( have to doublecheck that, cause i now am at a clients )… So actually the same issue as in the other post i did. Lack of ‘custom div’ i might be overseeing something simple though….

    #300943 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    336 pts
    @ssneg

    Interesting. Seems like “Other” is Lectora Online’s name for “Custom DIV” after all. However, since it is all wrapped in DIVs in the middle of the page, scripts might not always work. Try setting it to META TAGS and make sure the script is wrapped in script tags and no errors are reported in developer console in your browser.

    Also, feel free to share the files with me so I can have a look.

    #300945 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    Yep, that was what i am suspecting too. Gonna give it a try with metatags… Will let you know….

    #301233 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    @ Sergey, changed my coding habits to use Metatags. And indeed that solves some issues when importing a project from L11 to Lectora Online or L12.

    But one issue remains, but i guess thats easy to solve by refactoring my code a bit ( should not be needed, but well if this is all thats needed to get it to work 😉

    In L11 i call ( as you can see in the OOP sample i uploaded ) images and texts in Lectora by using:
    #image321363 or  $(‘.text322541Font1’)  or  #text322548
    In L11 either using JQuery or DOM , both methods work fine.
    L12 and Lectora Online however have changed the convention they used for their html-names. Now they are called:
    tobj321363 or  tobj322541 or tobj322548.

    Can someone confirm that for me ? If thats true just a refactoring of my code when exporting to L12 or Online will do.

    #301235 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    Update on my own reply:

    Yes, indeed the convention of htmlnames changed.

    Tested the #image321363
    Changed my javascript to use ‘tobj’ instead of ‘image’ and indeed all image-related elements work as before.
    Too bad they skipped the ‘text’ part in textobjects, because i used that to detect something was a text 😉
    Well, will find another solution for that for sure ….

    Thanks Sergey for the ‘Metatags’-part

     

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.