trials.thisTrialN does not get correct trial number in javascript

Hi @Tamer_Gezici,

I found a very tricky part of the JS logical judgment.

I used

if (window.MYTRIALN > 60 || window.MYTRIALN < 60){
    //alert('insideloop');
    continueRoutine = false;
}

And put it under Each Frames. The code works.

However, when I switched to

if (window.MYTRIALN != 60){
    //alert('insideloop');
    continueRoutine = false;
}

The code stopped working. Lol

I was also inlighted by JavaScript - continueRoutine = false -- problem online

Therefore, I put it under each frame. Also, I initialized window.MYTRIALN as a global variable.

In sum, sort of working. Thank you so much.

Miao