Giter Club home page Giter Club logo

githubworkshop's People

Contributors

everttj avatar kevinuulong avatar mergify[bot] avatar zsarge avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

everttj zsarge

githubworkshop's Issues

Too many error messages

When a new level is loaded it displays multiple errors instead of the single error it should be displaying.

Edit

I have an object that looks like this:

var object = {"keyword": "next", "other word": "wrong", "test": "wrong"}

it was loaded from a json file accessed from the server using the fetch API. I then have an input box that when a user enters one of the three keys of the object should echo its value on enter. If no keys are found in the string the user has input it should print out an error message. If the value of the key is "next" it should run a function called loadlevel() to load the next level. That next level is then loaded in the same way as the aforementioned one. This appears to be where I am having issues. When it loads the new json file it seems that both the previous object and the new object are still running. This causes it to print out the error message if the new input doesn't match both the new keys. See example below:

Setup:

//This is the first object loaded from the json file:
var object = {"keyword": "next", "other word": "wrong", "test": "wrong"}

What Should happen

When the user inputs the following strings it should have the corresponding outputs:

"this is the other word" => "wrong"
"hello, world" => "error"
"this is the keyword" => "next" loadlevel()

When the next level is loaded, say this for example:

var object = {"smith": "next", "hello": "wrong", "hi there": "wrong"}

It should then output this:

"this is the other word" => "error"
"hello, world" => "wrong"
"this is smith" => "next" loadlevel()

What is happening

The first values seem to work fine:

"this is the other word" => "wrong"
"hello, world" => "error"
"this is the keyword" => "next" loadlevel()

When the next level is loaded, say this for example:

var object = {"smith": "next", "hello": "wrong", "hi there": "wrong"}

It then outputs this:

"this is the other word" => "error" "error"
"hello, world" => "wrong" "error"
"this is smith" => "next" "error" loadlevel()

Tab Freezing when the last option is selected

Exactly as described in the title. The tab freezes when the third option is selected. Will test by adding a 4th option to see if it is just the third or the last in general and update the issue with those results.

Update

I have done more testing and it appears to just be the last option, not necessarily the third.

Only looking at the first word input

The program is not searching the entire string input. Likely has to do with the string not being properly converted to an array. Possibly some issues with spaces?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.