Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

OSWeb: t.replace is not a function

Hi folks,

I am trying to run my experiment through OSWeb. I can get through the first two blocks okay, but then I get an error that "t.replace is not a function" and the experiment stops. I should mention that it was working previously (maybe July or August?). I'm not familiar enough with Python to troubleshoot this.

Any help would be much appreciated!



  • edited October 2020

    Hi @lvkremin ,

    Can you post a screenshot of the browser console with the error message?

    I suspect that this is a bug in OSWeb related to showing a numeric value on a sketchpad , but I'd like to make sure.

    — Sebastiaan

    Buy Me A Coffee

  • Hi Sebastiaan,

    When I try to run the experiment in OpenSesame itself, I get the following:

    I'm not sure why it won't run at all in OpenSesame, but it will start in the browser. When I run it in the browser (Google Chrome), I get this:

    It may well be a bug about showing a numeric value. This is what the following screen should show:

    Thank you!

  • Hi @lvkremin ,

    Thanks for reporting this. That indeed seems to be the bug that I had in mind. This issue should be fixed for OSWeb 1.3.10.

    For now, a workaround would be to add some invisible text around the numbers, which will make sure that the numbers are treated as text. The   character (a space) is a good candidate. You can simply type this in front and after the number on the sketchpad , so that, if you view the script of the sketchpad , it should look something like this:

    draw textline center=1 color=white font_bold=no font_family=serif font_italic=no font_size=32 html=yes show_if=always text=" 1 " x=0 y=0 z_index=0

    Hope this helps!

    — Sebastiaan

    Buy Me A Coffee

  • Hi @sebastiaan

    Yes, that worked! Just a note, for me having " 1 " in the script didn't work - it still threw the error. But putting " 1 " did.


  • edited February 2021

    Hi @sebastiaan (and @lvanderlinden),

    I have encountered the same problem as Lena even though the issue should've been fixed as stated in Issue #40. See the attached picture.

    I've tried to include the  [multichar_response]  as well as  around the numbers underneath the words in the script without any help.

    Do you know how to fix it?

    Thanks in advance!



  • Btw my backend is Legacy and I get the same error-message if I'm using Chrome or Edge.

    You can have a look at my .oexp file here:

  • Hi @marbh ,

    The error looks superficially similar, but in your case it comes from your own script (not OSWeb), and more specifically from the count_incorrect item. Here you are trying to call vars.multichar_response.replace() , but this function does not exist if participants have entered a number so that vars.multichar_response is a numeric value rather than a string. Do you see what I mean?

    You would be able to avoid this error by checking whether the value is a string or not before calling the function. However, the question is why this script is there to begin with, and therefore whether it is safe to just bypass it like that. To know this, I would carefully go through the logic of the experiment, and try to understand the purpose of each item. (I suspect that the experiment is largely the result of copy-pasting?)

    if (typeof vars.multichar_response === "string") {
        vars.res = vars.multichar_response.replace(/enter|return|/gi, "")



    Buy Me A Coffee

  • Ah okay that makes sense. Thank you very much for your fast response. :)

    I definitely need to take a close look at the elements in the experiment as it is indeed a lot of copy-pasting.



Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games