html pages not showing

PennController for IBEX Forums Support html pages not showing

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7448
    vlanglois
    Participant

    Hi,

    I’m in the process of copying over some html pages that I’ve used in the old IbexFarm, but I noticed that the pages that I use javascript in don’t show up despite being included in the sequence (the otherlang and exit_screen html pages).

    Here’s the demonstration link to the PCIbex formatted experiment: https://farm.pcibex.net/r/AFfjMK/

    When using the old Ibex format, the pages do show up and work: https://farm.pcibex.net/r/THhfhS/

    I’m not sure if it’s because PCIbex doesn’t recognize the functions, or maybe I messed up something in the main script and forgot a comma, but the pages should look like the one from the second demonstration link.

    Thanks!
    Val

    • This topic was modified 2 years, 11 months ago by vlanglois.
    #7451
    Jeremy
    Keymaster

    Hi Val,

    All three HTML pages you include using newHtml (in the two trials labeled “demographics” and in the one labeled “exit_screen”) do show up in your experiment, but you have a wait command on the Button element only in the first trial, so the experiment rushes through the other two

    You can tell that all are included by looking at the Sequence tab of the debugger (once you reactivate it—it should only be turned off when you’re actively collecting data)

    Jeremy

    #7455
    vlanglois
    Participant

    Thanks! I figured it was something I was missing.

    Is there anyway to hide certain elements when the page first loads? I have a couple of conditionals, which work when you click on “No” for the first question. It works correctly when loaded as a HTML page locally, but not when it is called within PCIbex. Is it because the button is interfering with the javascript?

    https://farm.pcibex.net/r/AFfjMK/

    #7464
    Jeremy
    Keymaster

    Hi,

    Add these two lines just after your SCRIPT tag:

    const hideEm = ()=>{ 
    if (document.getElementById("numlang")===null) return window.requestAnimationFrame(hideEm);

    and these two just before function getVal(){:

    };
    hideEm();

    This will make sure that the hiding commands will only be run after the elements were added to the page

    Jeremy

    #7472
    vlanglois
    Participant

    Thanks! It worked perfectly.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.