aimacode / aima-javascript

Javascript visualization of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"
http://aimacode.github.io/aima-javascript/
MIT License
541 stars 219 forks source link

Ch22 page no longer refreshes when pressing enter #113

Closed OmarShehata closed 6 years ago

OmarShehata commented 6 years ago

This fixes #112

The problem was both forms had id #form and there was nothing to prevent the default browser behavior when submitting the second form. I gave them more descriptive id's so it's clear which is being referred to.

The other solution would have been to no longer have it as a form, but I kept it because having it as a form and the button being of type submit is convenient because the default browser behavior is that enter will trigger a click on that button (so we don't have to have a keypress listener).