Fixes #5111: remove javascript warning 'variable i redeclares argument'
Merge pull request #558 from ncharles/bug_5111/dev/js_warning

Fixes #5111: remove javascript warning 'variable i redeclares argument'