ここで関数を作成しました:
function locationOfVideo(){//Outputs video location div according to post text
var ytVideoDiv = '<div class="youtube-video"><div id="<?php echo $divName; ?>-video"></div></div>';
$j('#main .content:contains("<--video-->")').replace('<--video-->', ytVideoDiv);
}
これでうまくいくと思っていましたが、ひどく間違っていて、少し疲れています。とにかく、ここで何が間違っているのですか?