question

frostdamage avatar image
frostdamage asked

How to include jQuery into JS script

I'm using only js script for game logic, but I need to include jQuery for $.getScript method. Unfortunately, it isn't included, so this method is undefined. I cannot include it with <script>, obviously, and document.createElement has no profit too. Is there any way to include jQuery to my JS script?

CloudScript
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

frostdamage avatar image frostdamage commented ·

Even XML is not defined there. I cannot make any request. Is there a solution? Or it is not included?

0 Likes 0 ·

1 Answer

·
Andy avatar image
Andy answered

Assuming you're referring to Cloud Script, no, you can't include external libraries. You can absolutely make web requests from your Cloud Script, though. There's a tutorial here: https://api.playfab.com/docs/tutorials/landing-automation/making-webhook-calls-from-cloud-script. The precise feature set supported is discussed in more detail here and here.

Is there something you're trying to accomplish that isn't possible with the tools provided? I'd like to understand your scenario in more detail if so.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

frostdamage avatar image frostdamage commented ·

@Andy
Thanks for your answer. I wanted to define jQuery library by a request. Seems like this solution is appropriate for me. I will test this way and say if something will go wrong.

0 Likes 0 ·
frostdamage avatar image frostdamage commented ·

Hello again. Is there a way to make XMLHttpRequest with its properties?

0 Likes 0 ·
Andy avatar image Andy ♦♦ frostdamage commented ·

No, we don't support everything that you can do with an XMLHttpRequest. What are you trying to do that can be accomplished with the http object we provide?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.