Closed aturfah closed 6 years ago
Need to build list of things that need refactoring.
Function submit_form
:
$('#<element_id>')
append
instead of appendChild
Function update_opp_choices
:
$('#<element_id>')
append
instead of appendChild
Function update_team
:
$('#<element_id>')
append
instead of appendChild
Function submit_move
:
.get()
instead of xhr
Function update_log
:
$('#<element_id>')
append
instead of appendChild
Function create_team_list
:
make_pkmn_data_visible
to pokemon image hoverFunction update_gamestate
:
$('#<element_id>')
append
instead of appendChild
Function update_battle_finished
:
$('#<element_id>')
Function make_pkmn_data_visible
:
.addClass()
and .removeClass()
$('#<element_id>')
Do we even need this? The code isn't that bad and I can manipulate classes with regular JS
https://www.w3schools.com/howto/howto_js_add_class.asp https://www.w3schools.com/howto/howto_js_remove_class.asp
jQuery would make API calls easier, since it has the built-in .get()
method.
Disregarding comment above (with function refactoring); jQuery will be used to issue GET
and POST
requests.
I will use native JS's add/remove class methods included in links 2 comments before.
Addressed in #103
Right now it just uses raw JS.
In order to make my life less hellish it needs to be rewritten/refactored with jQuery. The sooner the better.