0

I've used Custom CSS and JS plug in to add gamesparks html and js to the page. You can visit it at www.martialparks.com

I'm trying to initialize the sdk with the intent to send and receive authentication requests with my gamesparks server (at least.) When I enter my API key and secret...nothing happens.

I feel like something should happen.

When I inspect the page, I found a few errors (I think.)

JQMIGRATE: Migrate is installed, version 1.4.1 (index):42 GET my gamesparks.js link net::ERR_ABORTED (index):43 GET my second gamesparks.js net::ERR_ABORTED (index):44 GET my third gamesparks.js net::ERR_ABORTED (index):59 Uncaught ReferenceError: GameSparks is not defined at (index):59 (anonymous) @ (index):59 (index):201 Uncaught ReferenceError: GameSparks is not defined at (index):201

But I don't know java. Or HTML.

So I have no idea if those are even errors.

I'm pretty good at learning autonomously, and trouble shooting, but this is beyond me.

Anyone care to give me some input on what I should be doing???

  • 1
    If there are errors in your browser console the issue is javascript related. You should make sure that your javascript libraries are loaded and are in the correct order if something is 'not defined'. Also you should direct your queries to 'GameSparks' as this is not Wordpress related and is off topic here. – ngearing Oct 5 '17 at 23:26
  • The fact that the js is gamesparks seems irrelevant to me. I could have had any random js added. – Velocity Martial Arts Oct 6 '17 at 11:40
  • I will attempt to reorder the loading sequence of the js and see if that helps. I've also noticed that it attempts to find the js at my website/whatever.js. I'm not sure exactly where to save the js files in my wordpress file manager. wp-content? Do I have to? I thought I could just include javascript as part of the wordpress, without having to save random js files in the file manager. – Velocity Martial Arts Oct 6 '17 at 11:43
  • Update: I went through the code and found that each of the three javascripts were in order. Nothing is referenced before it exists. All variables are defined first. It looks like the java is just not loading. – Velocity Martial Arts Oct 6 '17 at 20:42
  • Update: So I uploaded the javascript to different file paths. wp-admin/js, and public. Neither of those places are referenced, apparently. This thing is looking for my javascript, I just have no idea where to put it! I think once it finds it, it will then be able to define that crazy variable too. – Velocity Martial Arts Oct 6 '17 at 20:44
0

VICTORY. At least...no 404 anymore. I haven't actually tried to use the script yet, too excited. Thanks for the direction, Nath!

Here is what I did. I went to my theme and created a subfolder titled, "js." In the same theme, I edited header.php to include the following just below :

(The part in bold, I just changed to whatever exact js I wanted.)

I reloaded the page and used my inspect element thing on my browser, and still had errors! But then I remembered I was using the old stupid references somewhere. I deleted them and...there we go. New reference in, new subfolder...let me try to see if the java actually works...stand by...

No, it doesn't.

But that will end up under a totally different topic. I know what I just did was elementary to you hardened WPressers, but for someone who has never done this...I'm pleased with myself.

Now on to figure out why the javascript isn't bouncing off my backend server!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.