Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Why is the sending thing of my html5 game is not working properly but works on my game engine?

A topic by GGaMErZZ created Apr 17, 2021 Views: 340 Replies: 3
Viewing posts 1 to 2
(2 edits)

code:

    try {
	var xhr;
    if (typeof XMLHttpRequest !== 'undefined')
		xhr = new XMLHttpRequest();
    else {
        var versions = ["MSXML2.XmlHttp.5.0",
                        "MSXML2.XmlHttp.4.0",
                        "MSXML2.XmlHttp.3.0",
                        "MSXML2.XmlHttp.2.0",
                        "Microsoft.XmlHttp"]

         for(var i = 0, len = versions.length; i < len; i++) {
            try {
                xhr = new ActiveXObject(versions[i]);
                break;
            }
            catch(e){}
         } // end for
    }

and how to solve it?

game made and exported in GDevelop

i see no problem in this at all

im using a HTTPS web to comunicate with the app/HTML5

Admin

Without an error message it’s not easy to help you.

BTW, all current browsers for the past many years support XMLHttpRequest, creating an ActiveXObject is not necessary.

i know its not necessary but its from my game engine and i dont wanna break it by accident anyway

networktools.js:39 Access to XMLHttpRequest at ‘https://(dont want peoples to know)/game/refresh.php’ from origin ‘https://v6p9d9t4.ssl.hwcdn.net’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Admin(+1)

You’re trying to communicate with a server that is missing the headers required for Cross Origin requests. Try searching CORS on Google to learn how to configure your PHP script to return the correct headers.

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.