<%= semantic_form_for :......... do |f| %>
<%= f.inputs do%>
<%= pluralize @size, 'Profitable Routes to test'%>
<p>User id: <%= @id %><p>
....
<title> audio player</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="/skin/pink.flag/jplayer.pink.flag.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function(){
var u_id = document.getElementById('id')
$("#jquery_jplayer_1").jPlayer({
......
......
......
.......
});
});
//]]>
</script>
我想将 传递User id
给 javascript,我正在尝试这样做:var u_id = document.getElementById('id')
但它说 u_id 为空,我可以通过谁?谢谢!