evalScripts

evalScripts() -> [returnedValue...]

Evaluates the content of any script block present in the string. Returns an array containing the value returned by each script.

Examples

'lorem... <script>2 + 2</script>'.evalScripts();
// -> [4]

'<script>2 + 2</script><script>alert("hello world!")</script>'.evalScripts();
// -> [4, undefined] (and displays 'hello world!' in the alert dialog)