Two boys were charged after they posted threatening messages to an Illinois high school on social media, police said.