<%
String[] name = { "w ", "a ", "n ", "g"};
%>
<script>
var newname=new Array();
<% for(int i=0;i <name.length;i++){ %>
newname[ <%=i%> ]= " <%=name[i]%> ";
<% } %>
</script>
转载于:https://www.cnblogs.com/boguse/p/6685495.html