jQuery now included by default in Qualtrics

AnthonyRAnthonyR Tucson AzFounding Community Member Superuser ✭✭✭✭

jQuery now included by default in Qualtrics

This is a great piece of information I was informed f today, turns out, a few months ago jQuery was added to Qualtrics as a default!

The one caveat being that you need to use jQuery instead of $ to reference it (obviously done to not break legacy code that relies on prototype.js.

More details here: https://www.qualtrics.com/support/survey-platform/survey-module/question-options/add-javascript/#Guidelines

Thought I would share, since as far as I know this wasn't ever really "announced", but it is super helpful.

Anyone else that didn't know this had been added?

Comments

  • benmbenm Community Member Qubie ✭

    Hi @AnthonyR, thanks for sharing, I didn't know either. This is great news, one less step when doing squirrelly things with JavaScript :)

  • AbdulDezkamAbdulDezkam [email protected]Community Member Guru ✭✭

    What if the different websites/platforms you run Qualtrics Site Intercepts on, are depending on different version of JQuery libs? Wouldn't this Qualtrics JQuery conflict with that? Or would it be okay because Site Intercept is iframed and thus not conflicting with the JQuery version on your website?

  • AnthonyRAnthonyR Tucson AzFounding Community Member Superuser ✭✭✭✭

    @AbdulDezkam That is correct, it will be contained to the iFrame and shouldn't give you any trouble.

  • TomGTomG Raleigh, NCCommunity Member, Product Ideas Wizard ✭✭✭✭✭

    There is a flip-side to this announcement. In the next few months Qualtrics will announce that Prototypejs will be eliminated, and then it will go away 3 to 6 months after the announcement. I expect it will be gone by Q4 2018 or shortly thereafter.

    So, my advice is to start planning on updating your scripts to use jQuery instead of Prototypejs. We have some surveys that are fielded throughout the entire year, so I've already been updating those so that we don't have to make changes in the midst of fielding. Also, we are using jQuery for all new scripts.

    Background: In mid-November, Qualtrics made a JFE update that unintentionally broke parts of Prototypejs (the namespace went missed, as well as layout and form functions). This resulted in a lot of communication (and some miscommunication) between myself, our Client Success Manager, Support and Engineering. Since that time, Qualtrics has been working to fix what was broken (it appears they aren't quite there yet). Anyway, during the process they let me in on the longer range plan for Prototypejs.

  • EmilyEmily Provo, UTCommunity Administrator Administrator

    @TomG said:
    There is a flip-side to this announcement. In the next few months Qualtrics will announce that Prototypejs will be eliminated, and then it will go away 3 to 6 months after the announcement. I expect it will be gone by Q4 2018 or shortly thereafter.

    So, my advice is to start planning on updating your scripts to use jQuery instead of Prototypejs. We have some surveys that are fielded throughout the entire year, so I've already been updating those so that we don't have to make changes in the midst of fielding. Also, we are using jQuery for all new scripts.

    Background: In mid-November, Qualtrics made a JFE update that unintentionally broke parts of Prototypejs (the namespace went missed, as well as layout and form functions). This resulted in a lot of communication (and some miscommunication) between myself, our Client Success Manager, Support and Engineering. Since that time, Qualtrics has been working to fix what was broken (it appears they aren't quite there yet). Anyway, during the process they let me in on the longer range plan for Prototypejs.

    Hi Tom,

    We just wanted to clarify a few things here. You will still be able to load the prototype.js file yourself, if you would like. The only thing that will be changing is that the prototype.js file will no longer be included by default.

    Hopefully that helps clear things up a bit!

  • TomGTomG Raleigh, NCCommunity Member, Product Ideas Wizard ✭✭✭✭✭

    @Emily,

    I realize we could load prototype ourselves, but that seems risky to me. As users, we have no way to test that exact configuration in advance. If there were any issues or conflicts, we wouldn't find out until the day prototype is removed. I was in that position back in November when parts of prototype were disabled and it wasn't fun. Besides, since jQuery is the direction of the future, with plenty of time, it seems best just to get on with it...and I say that as someone who has a large library of Qualtrics scripts that use prototype.

  • AnthonyRAnthonyR Tucson AzFounding Community Member Superuser ✭✭✭✭

    @TomG Thanks for sharing. I suppose it is time to start updating my pretty extensive library of scripts as well!

  • AnthonyRAnthonyR Tucson AzFounding Community Member Superuser ✭✭✭✭
  • TomGTomG Raleigh, NCCommunity Member, Product Ideas Wizard ✭✭✭✭✭

    Thanks for the cheat sheet @AnthonyR .

    Here is something that had me flummoxed for awhile, so it may help others. jQuery doesn't like tildes (~) in element id strings. They have to be escaped with \\. For example:

    var el = jQuery('#QR\\~'+qid+'\\~'+choice);

Sign In to Comment