Let's say you have two buttons. Their ids are:
bob
bobs burgers
You use jquery to .load a php page in a div element like follows:
var teamSelect = $(this).attr('id');
$("#loadTables").load("php/leagueTable.php?team="+teamSelect);
Now bob will run just fine, but bobs burgers has a space and does not work. The address ends up being
"php/leagueTable.php?team=bobs"
I have no control over the fact that there will be spaces in the button Ids. The buttons are generated from a database and these names will always have spaces. How can I deal with this?