javascript - Calling jquery plugin functions on JS callback -


i've searched answer question haven't had success. using audio.js plugin audio playback , stream files with:

// within index.html.erb audio.load($('.track_info a', clicked_node).attr('data-src')); audio.play(); 

when placed in script block on html page, works perfectly. problem i'm having involved attempting call audio plugin through js callback. nothing happens when following:

// callback.js.erb audio.load('<%= "#{@song.sample_url}" %>'); audio.play(); 

even when wrap with:

$.getscript('/javascripts/audio.js', function(){     alert("successfully loaded audio."); )}; 

any ideas?

p.s. - other jquery within callback.js.erb work properly.

try this:

$.getscript('/javascripts/audio.js', function(){     audio.load('<%= @song.sample_url %>');     audio.play(); )}; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -