Just to make sure: you realise that the i and a variables that you stick in that innerHTML string are not the variables i and a but just letters in a string, right? That aside, when do you get that error? When it runs, or when you click on the resulting link? (because if you try the latter, it will fairly obviously break when it tries to execute a=i in global context. Also: don't do this, use function calls)
iandavariables that you stick in that innerHTML string are not the variablesiandabut just letters in a string, right? That aside, when do you get that error? When it runs, or when you click on the resulting link? (because if you try the latter, it will fairly obviously break when it tries to executea=iin global context. Also: don't do this, use function calls)