Avatar of James Hancock
James HancockFlag for United States of America

asked on 

Why does this Javascript work on a device, but not a. browser?

Hi
I wonder why this attached Javascript game code only works on a phone (iPhone XR) and not a MacBook Safari browser?

It is just a Phaser JS image displaying a man writing at a table. Don't forget to make a 'cards' folder for the image.
How do I change it to have a white background, in addition?

- EEimageBrowserQ.zip

Thanks
Game ProgrammingJavaScript

Avatar of undefined
Last Comment
David Favor
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Perhaps you are using phaser 2 on the device and phaser 3 on your browser?

https://phaser.io/tutorials/making-your-first-phaser-3-game

Phaser 3 does not have state.
Avatar of David Favor
David Favor
Flag of United States of America image

If people are slow commenting, post the URL of where your game is running to test.
Avatar of James Hancock
James Hancock
Flag of United States of America image

ASKER

Thanks

This is infuriating!

It works if I use "localhost" on my dev MacBook, the ip address on my client/test machine-Macbook, works on my Godaddy file system/ and a URL (apologies for mentioning the G word, but it is useful in some cases) and works on my iPhone w IP address, but not ip address on my dev.

Make any sense?
ASKER CERTIFIED SOLUTION
Avatar of James Hancock
James Hancock
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of David Favor
David Favor
Flag of United States of America image

Another consideration you'll have is your ISP.

Many ISP's quietly block connections to your public IP... or said another way, block any listeners running on your local IPs.

So you can connect via localhost, never any other way.

If you're trying to run a service with public access, lease hardware somewhere, like OVH.
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo