From the example of the scripts, it looks like you're missing a reference to jQuery (which isn't a default library - you have to explicitly include it before any scripts that use it on pages where you need it).
Adding this (before your other script tags) should fix it:
<script type='text/javascript' src='http://code.jquery.com/jquery-latest.min.js'></script>
Also, I would recommend not using 'live', as it's deprecated. Instead, you should use 'on', together with delegation. With your HTML example above, this could be done with the following edit:
$('#container > h1 > nav > ul').on('click', '#stream', function(){
SC.stream("/tracks/000000000", {autoPlay: true});
});
- This will trigger the handler only if the click was on the
#stream
element - but the#stream
element doesn't need to be on the page to begin with - only the containerul
does. If you're creating theul
dynamically as well, you can go 'up' one level and change the selector to this#container > h1 > nav
(which has a similar effect, but here theul
can be dynamically added as well).
More on event delegation with 'on': https://api.jquery.com/on/
..hope this helps!