Best way to add jQuery to C3

  • Hi,

    I'm trying to connect my game to my Drupal website using Drupal services and the whole mission is giving me a gripping headache.

    I'm using ValerypopoffJS plugin to incorporate Javascript into my game.

    C3 no longer has jQuery as a dependency as mentioned here.

    jQuery would really help what I'm trying to do though. My question is: what's the best and easiest way to include jQuery so I can use it in .js files with ValerypopoffJS?

    Many thanks,

    Ben

  • Phacanu made a good solution for that.

    1. Include JQuery to the JS plugin.
    2. If you have a plugin that has code inside the instanceProto.OnCreate(). Turn that into an 'Initialize' Action. Then before using the plugin.
    3. Then, before using the plugin. Make sure to call the Initialization first. On Loader Layout, for example.

    That is for JQuery dependent plugins. Although, in your case. Just include JQuery into your project and use the JS plugin to include it on the runtime. And you are good to go!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • chadorireborn, Thanks so much for getting back so quickly on this. I highly appreciate it. At the risk of sounding like a complete muppet, how do I do step 1?

    C3 plugins are in a .c3addon file. I'm not sure how to edit them.

    Apologies if I'm being a "help vampire". I'm having one of those head + brick wall days.

    Cheers,

    Ben

  • You don't need to edit vallerypoffs plugin, just download jquery from

    https://code.jquery.com/jquery-3.3.1.min.js

    then make a new js file in c3 copypaste the code from jquerys cdn paste it into that file then just include it like

    https://i.imgur.com/KTRzTCc.png

  • Lovely! Thanks for that :)

    I also just noticed Chadorireborn has a C3 plugin called "jQuery Plugin" so I'll check that out too.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)