[Solved] Error in HTML5 exporting

Just started using Construct 2? Post your questions here

Post » Thu Aug 25, 2016 8:46 am

I am sure it's my error somewhere, but...

I have tried to host my game on a website, and I have this situation just after loaded:

Image

While it should be like this:

Image


What am I missing?

It seems it doesn't start with the functions...

Image


Many thanks in advance :)
Last edited by JeffSkyrunner on Tue Sep 06, 2016 7:14 am, edited 1 time in total.
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Thu Aug 25, 2016 9:12 am

Might check the mime types the server allows.
Image ImageImage
B
172
S
50
G
182
Posts: 8,432
Reputation: 115,083

Post » Thu Aug 25, 2016 9:26 am

Could you please point me in the right direction? What have I to check? ^^;


Edit: Maybe I've found something... I am working on it, I'll let you know
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Thu Aug 25, 2016 10:14 am

Nope, I've tried editing my .httaccess file, but still nothing new.

This is my file:

--
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /

AddType text/plain .txt
AddType text/html .html .htm
AddType text/css .css
AddType text/xml .scml .xml
AddType text/csv .csv
AddType text/cache-manifest .appcache
AddType image/svg+xml .sgv
AddType image/png .png
AddType image/jpeg .jpeg .jpg .jpe .JPG
AddType audio/ogg .ogg .opus
AddType audio/mp4 .m4a
AddType video/webm .webm
AddType video/ogv .ogv
AddType application/font-woff .woff
AddType application/json .scon .json
AddType application/x-web-app-manifest+json .webapp
AddType application/manifest+json .manifest
AddType application/pdf .pdf
AddType application/zip .zip
AddType application/javascript .js

--

Edit:

The console says the error is Cross-Origin Request Blocked, so I changed my .httaccess in this way:

---
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /

<FilesMatch "\.(php)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>


AddType text/plain .txt
AddType text/html .html .htm
AddType text/css .css
AddType text/xml .scml .xml
AddType text/csv .csv
AddType text/cache-manifest .appcache
AddType image/svg+xml .sgv
AddType image/png .png
AddType image/jpeg .jpeg .jpg .jpe .JPG
AddType audio/ogg .ogg .opus
AddType audio/mp4 .m4a
AddType video/webm .webm
AddType video/ogv .ogv
AddType application/font-woff .woff
AddType application/json .scon .json
AddType application/x-web-app-manifest+json .webapp
AddType application/manifest+json .manifest
AddType application/pdf .pdf
AddType application/zip .zip
AddType application/javascript .js

--

but still I cannot make it work.

Is there anybody who can teach me on how have I to write a correct .htaccess file? :)
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Thu Aug 25, 2016 4:07 pm

BTW, here is the URL: http://testacc.netne.net/XWing/

Maybe somebody more xpert than me can help, looking at the console :)
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Thu Aug 25, 2016 4:11 pm

Cross origin request? Are you referencing something hosted on a domain sperate from where you uploaded to?

It is not your server that's blocking the request usually, it is the one you are trying to get the file from.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Thu Aug 25, 2016 8:04 pm

I am not referencing nothing at all... maybe it can be the json files I load? But they are local files... or, at least, they should be... :look:

Edit: This is how I make the call:

Image
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Sat Aug 27, 2016 8:24 am

Any idea somebody?

The "final" version of my .htaccess, after tons of tests, is now:

# DO NOT REMOVE THIS LINE AND THE LINES BELOW HOTLINKID://www.google.com
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://testacc.netne.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://testacc.netne.net$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.testacc.netne.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.testacc.netne.net$ [NC]
RewriteRule .*\.(zip|rar|exe|mp3|pdf|swf|psd)$ http://http [R,NC]
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE //www.google.com:HOTLINKID

# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteEngine On
RewriteBase /XWing/

<FilesMatch ".(json|css|scml|woff|webapp|appcache)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>

AddType text/plain .txt
AddType text/html .html .htm
AddType text/css .css
AddType text/xml .scml .xml
AddType text/csv .csv
AddType text/cache-manifest .appcache
AddType image/svg+xml .sgv
AddType image/png .png
AddType image/jpeg .jpeg .jpg .jpe .JPG
AddType audio/ogg .ogg .opus
AddType audio/mp4 .m4a
AddType video/webm .webm
AddType video/ogv .ogv
AddType application/font-woff .woff
AddType application/json .scon .json
AddType application/x-web-app-manifest+json .webapp
AddType application/manifest+json .manifest
AddType application/pdf .pdf
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Mon Sep 05, 2016 9:31 am

No idea? What am I missing?

Sorry for the "newbieness" ( :look: ) of the question...
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Tue Sep 06, 2016 7:14 am

"Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth"

Since I don't know nothing about web programming and I am still learning, I thought the problem was on some misterious file/configuration... instead was much more simpler: once the file were uploaded, they became all lower case, so "Ships.json" become "ships.json" and so the error the console gave should be interpreted as "file not found" and no cross reference... :)
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest