Twitter script creates infinite refresh loop in ie 9


The script pasted below which I got from the best practice blogs here creates an infinite refresh loop rendering navigation impossible. Seems to be working fine in ie 10, 11, FF and Chrome, just not ie 9. The website has a significant number of users running ie 9 and must be made to work. Has anyone else seen this? TIA


Thanks for all the help