-1

What is wrong in this code? it shows an Syntax error in eval(e.text); //run the script

  runScripts1: function(e) {
        if (e.nodeType != 1) return false; //if it's not an element node, return

        if (e.tagName.toLowerCase() == 'script') {
            eval(e.text); //run the script
        }
        else {
            var n = e.firstChild;
            while ( n ) {
                if ( n.nodeType == 1 ) forrester.runScripts1(n); //if it's an element node, recurse
                n = n.nextSibling;
            }
        }
        return true;
    },

Thanks

3
  • 2
    What is the value of e.text? Either debug the code or show it with alert or Console.write and post here. Commented Oct 24, 2011 at 8:09
  • But the error is thrown only in ie7. Thanks for the reply i will do an alert and check... Commented Oct 24, 2011 at 8:47
  • You should mention this in the question, we can't guess such thing. Commented Oct 24, 2011 at 8:48

1 Answer 1

3

It seems likely that the syntax error is inside the e.text -- that the script tag you're manually evaluating itself has an error.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.