I am writing a wordpress wordpress plugin to inject some javascript and html right into a publish. While using "the_content" filter I have the ability to place my tag with all of my javascript functions and every one of my html markup later on. The issue is the scripts dont work and firebug labels it a syntax error without having to be very precise regarding in which the error lies.

This is actually the content from the javascript tags that will get placed in to the page which does not appear to carry any type of syntax error after i check it.

    <![CDATA[ 
    Votes = {};
    $(document).ready(function()
    {
        $(".starContainer span").hover(sr_addBG("http://revealcoupons.com/wp-content/plugins/StarRatingLite/images/stars.png"), sr_removeBG());
    });
function sr_addBG(ImgURL){
    $(this).css("background","transparent url("+ImgURL+") repeat-x 0 -60px");
}
function sr_removeBG(){
    $(this).css("background","none");
}
function sr_castVote(ID,Vote, ImgURL){
    Votes[ID] = Vote;
    $("#starContainer"+ID+" span").css("background","none");
    $("ID"+ID+"Star"+Vote).css("background","transparent url("+ImgURL+") repeat-x 0 -60px");
}
function sr_verifyVote(NbFeatures){
    var count = 0;
    for (var e in Votes)
    {count++;}
    return count >= NbFeatures;
} 
function sr_submitVotes(NbFeatures, PostID){
    if (sr_verifyVote(NbFeatures))
    {
        ajaxReq = new XMLHttpRequest();ajaxReq.onreadystatechange=function() 
        {
            if (ajaxReq.readyState == 4 && ajaxReq.status == 200)
            {
                alert("BAM! vote submitted. Thank you");
            }
        }
        var voteStr = "";
        for (var vote in Votes)
        {voteStr += vote+"[eq]"+Votes[vote]+"[amp]";}
        voteStr = voteStr.substring(0, voteStr.length - 5);
        ajaxReq.open("http://revealcoupons.com/wp-content/plugins/StarRatingLite/StarRatingLite.php?PostID="+PostID+"&votes="+voteStr");
        ajaxReq.send();
    }
    else
    { 
        alert("You must vote on all features before submitting your opinion.");
    }
}]]&gt;

The only real error that firebug yields is "syntax error" without having to be more specific. The only real factor I've not written per same with the finish from the cdata section in which the ">" character got instantly changed by ">".

Thank you for any input!

your .hover() is wrong. it's expecting 2 function handlers, and rather you're passing undefined two times

try with this particular, were i added function wrappers

$(".starContainer span").hover(function(){sr_addBG("http://revealcoupons.com/wp-content/plugins/StarRatingLite/images/stars.png")}, function(){sr_removeBG()});