On Demand Javascrpt execution - need some help

Discussion in 'JavaScript' started by grein46087, Nov 29, 2006.

  1. #1
    All,

    I am doing some AJAX coding, and have a small problem.
    On a particular request the server side code returns a script tag.
    <script type="text/javascript" id="scriptToExecute">
    $("Accordian").visualEffect("Accordian",{headingSelector:"h5",sectionSelector:"div.Accordian-Blind",showSection: 0, duration: 0.3});
    </script>

    On the client side, my onComplete handler invokes a function, that pulls the Script value and evals it.
    function processAnyOnDemandJavascript()
    {
    var scriptElement = $("scriptToExecute");
    if ( scriptElement != null )
    {
    var nodeValue = $("scriptToExecute").firstChild.nodeValue;
    var temp = eval(nodeValue);
    }
    }


    The problem, I have is that after the execution ( no errors ) it "seems" to just disapear and do nothing, What is the clue that I missed here.

    Many thanks for any assistance
     
    grein46087, Nov 29, 2006 IP