I have an ASP script that is populating a javascript variable from a database. The current code i have works great in firefox, but in IE i'm having no luck. If you look at the example below you'll see that i have a comma at the end of my array. I don't know how to code arround this. Firefox does not care that my array has an extra comment, but silly IE hates it. Any suggestions?
CODE:
Response.write("<script language='javascript'>")
Response.Write("var TABLE_CONTENT = [ ")
Do until rs.eof
Response.write("[" & "'" & rs("procedure_num") & "'" & ", " & "'" & "<a href=""" & rs("location") & """> " & rs("procedure") & "</a>'" & ", " & "'" & rs("description") & "'" & ", " & "'" & rs("revision") & "' " & "],")
rs.movenext
loop
Response.Write(" ];</script>")
end if
RS.Close
CODE:
Response.write("<script language='javascript'>")
Response.Write("var TABLE_CONTENT = [ ")
Do until rs.eof
Response.write("[" & "'" & rs("procedure_num") & "'" & ", " & "'" & "<a href=""" & rs("location") & """> " & rs("procedure") & "</a>'" & ", " & "'" & rs("description") & "'" & ", " & "'" & rs("revision") & "' " & "],")
rs.movenext
loop
Response.Write(" ];</script>")
end if
RS.Close