Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Option selects not filtering on mobile

I created a small scoreboard app using a mixture of JavaScript and Jquery. When you select a country it filters the list of competitions by adding or removing classes and it all works as it should when I am on my laptop.

The issue has come when I try to use it on an iPhone. The competitions don't filter as they should even though I am using chrome on my laptop as well as on my phone.

Here is the repo, tried changing the selectors from Jquery to JavaScript but didn't work.

https://github.com/martincavaliers/scoreboard

Any help would be great.

Thanks

I think you forgot the link.

You're absolutely right brad, sorry been a long day. Put the link in the question now. Thank you.

Can you tell me how to test your app? I cloned it, and in the browser most countries I choose it says there's no data for the country. Some countries have a competitions but then it says there's no data for the competition. Which countries and competitions definitely have data?

One interesting thing, I looked in my console and saw that there was an error in the Network tab for this url: http://api.football-data.org/v2/competitions/2078/standings if I test it directly I get this error:

errorCode: 403
message: "The resource you are looking for is restricted. Please pass a valid API token and check your subscription for permission."

1 Answer

Due to the API most countries have no info but if you try the main ones like England, France, Germany and their top leagues then there is info that comes in.