hi and thanks for stopping.
i already solved my problem, but on my own, so i just want to share my solution and maybe someone has a more elegant way to solve it. maybe its just nice as it is.
so im loading some html via jquery.ajax() and the dataType is html. sometimes a video is placed inside, and the most elegant way for me to embed this, is the jwplayers js embed code, that looks like this:
<script>
jwplayer("mediaplayer").setup({
flashplayer: "/player.swf",
image: "/image.jpg",
autostart: true,
'controlbar': 'none',
file: "/video.m4v",
width: 752,
height: 416
});
</script>
now if i load this, nothing happens, the js just doesnt get executed.
so i ended up putting the js WITHOUT the script tags into a div.
<div id="vc">
jwplayer("mediaplayer").setup({
...
});
</div>
and then in my ajaxComplete() call i simply move the stuff out of the div and place it in between two script tags.
if ($("#vc").text() !== "") {
var vjs = $("#vc").text();
$("#vc").empty().html("<script>"+vjs+"</script>");
}