Knightwalker
Knightwalker

Reputation: 377

AJAX Load on the client side workaround | Cross Origin requests error

I am aiming to create a visual novel, "click" progression game. I am aiming to achieve that using purely HTML, CSS and JS. The game is supposed to run only on the client side from index.html in the browser.

My question is, I am hitting up some trouble with those cross origin requests and I'm trying to figure out a solution from 2 weeks now, and i have no idea how to make this happen. Error "Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource."

What i want to achieve is very simple. Instead of using something like twine engine, i would like to write native, because it will be more productive and faster for me.

Options i tried so far:

What can i do to get this running? I know C#, but before i move to .exe is there anyway i can get this done? Will react.js work client side only and load components without CORS error? Never tried the framework, because in the tutorials i see they use a webserver.

Any ideas? Thanks beforehand!

Upvotes: 0

Views: 106

Answers (1)

Quentin
Quentin

Reputation: 944301

Will react.js work client side only and load components without CORS error?

No, because it will still be another thing that runs in the browser and is subject to the limitations imposed by the browser.

You need a server, a browser which doesn't impose those limitations, (something that sort of combines the two like Electron), to use a dirty hack like JSONP to load the files, or to wrap up all the files so they are embedded in the JS you load initially.

Upvotes: 1

Related Questions