jquery and jotform conflict

  • Profile Image
    Asked on March 07, 2016 at 12:23 PM

    Our app is a single-page application (using javascript on both back and frontend), and I'm having trouble getting jquery and jotform to work on the same page. I cannot use an iframe because we have our own custom analytics we need to run, and iframes are also a PAIN to work with. I'm using the source code for the form, and it is causing issues, saying "JotForm is not defined".


    I have tried using $.noConflict() for this one page, and it still seems to be causing issues (saying JotForm is not defined). Has anyone come up with a comprehensive solution for this problem? Please do not ask me to globally run $.noConflict(). Our codebase is huge and that is simply not a feasible solution. I've uploaded the console error so you can take a look at the specific line of jquery that is causing this issue.

  • Profile Image
    Answered on March 07, 2016 at 03:38 PM

    This will indeed happen if you load form's full source code and other JS libraries on the same page. Unfortunately, the solutions you mentioned like using iFrame embed code and using $.noConflict globally in your other library are the only ones that we have. It is also mentioned in the jQuery $.noConflict documentation that this is the current solution that they have to avoid conflict from other JS libraries with jQuery: https://api.jquery.com/jquery.noconflict/