JSFiddle - React, Tailwind, and code Playground
JavaScript
var pageFunctions = {
thing_page: function() {
// Code for thing_page
$('#thing_page input.finder').focus(function(){...});
},
other_page: function() {
// Code for other_page
},
third_page: function() {
// Code for third_page
}
};
// Now call the correct function, according to the body ID
pageFunctions[ $(body)[0].id ]();