Well, when I run it, the message "Sound loaded!" appears, but the
scripts are not rendered (I inspect the elements with Chrome and with
Firebug, and the scripts do not appear).
Is there anything wrong when I try to do this? Is there a way to make
this work?
Well, when I run it, the message "Sound loaded!" appears, but the
scripts are not rendered (I inspect the elements with Chrome and with
Firebug, and the scripts do not appear).
Is there anything wrong when I try to do this? Is there a way to make
this work?
Why not just call the script file from a <script> tag instead of
replace_html? In general, your JavaScript should be coming from static
external files.
Why not just call the script file from a <script> tag instead of
replace_html? In general, your JavaScript should be coming from static
external files.
Well, now I tried. I have tried this on my view:
<script type="text/javascript">
var q_sound='<%= url_for_file_column('question', :sound) %>';
</script>
<script type="text/javascript">
//<![CDATA[
soundManager.onload = function() {
if(q_sound!='') soundManager.createSound("question_sound", q_sound);
}
//]]>
</script>
Why not just call the script file from a <script> tag instead of
replace_html? In general, your JavaScript should be coming from static
external files.
Well, now I tried. I have tried this on my view:
<script type="text/javascript">
var q_sound='<%= url_for_file_column('question', :sound) %>';
</script>
<script type="text/javascript">
//<![CDATA[
soundManager.onload = function() {
if(q_sound!='') soundManager.createSound("question_sound", q_sound);
}
//]]>
</script>