P粉8385635232023-08-28 09:33:34
To be clear - yes, the error states that you cannot point the browser directly to file://some/path/some.html
Here are some options to quickly start a local web server and let your browser render local files
If you have Python installed...
Use the command cd /path/to/your/folder
Change directory to the file some.html
or the folder where the file is located< /p>
Use the command python -m SimpleHTTPServer
This will start a webserver to host your entire directory listing at http://localhost:8000
python -m SimpleHTTPServer 9000
gives you the link: http://localhost:9000
This method is built into any Python installation.
Perform the same steps but use the following command python3 -m http.server
If you use Visual Studio Code, you can install the Live Server extension to provide a local web server environment.
Or if you need a more responsive setup and are already using Nodejs...
Install http-server
by entering
npm install -g http-server
Switch to your working directory, where some.html
is located
Start your http server by issuing http-server -c-1
http://localhost:8080
ruby -run -e httpd . -p 8080PHP
php -S localhost:8000
P粉3099896732023-08-28 09:00:16
My crystal ball says you are loading the model using file://
or C:/
which matches the error message as they are not <代码>http://
So you can either install a web server on your local PC or you can upload the model somewhere else and use jsonp and change the url to http://example.com/path/to/model
Origin is defined in RFC-6454 as
...they have the same scheme, host, and port. (See Section 4 for full details.)
So even if your files originate from the same host (localhost
), they are considered different as long as the scheme is different (http
/ file
) origin of.