[qooxdoo-commit] SF.net SVN: qooxdoo:[17662] trunk/qooxdoo/framework/source/class/qx/lang/ Function
Brought to you by:
ecker,
martinwittemann
From: <ec...@us...> - 2009-02-06 13:38:45
|
Revision: 17662 http://qooxdoo.svn.sourceforge.net/qooxdoo/?rev=17662&view=rev Author: ecker Date: 2009-02-06 13:38:31 +0000 (Fri, 06 Feb 2009) Log Message: ----------- [BUG #1912] Re-examine global JS evaluation Modified Paths: -------------- trunk/qooxdoo/framework/source/class/qx/lang/Function.js Modified: trunk/qooxdoo/framework/source/class/qx/lang/Function.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/lang/Function.js 2009-02-06 13:17:56 UTC (rev 17661) +++ trunk/qooxdoo/framework/source/class/qx/lang/Function.js 2009-02-06 13:38:31 UTC (rev 17662) @@ -29,18 +29,7 @@ License: MIT: http://www.opensource.org/licenses/mit-license.php - - - * jQuery - http://jquery.com - Version 1.3.1 - Copyright: - 2009 John Resig - - License: - MIT: http://www.opensource.org/licenses/mit-license.php - ************************************************************************ */ /* ************************************************************************ @@ -163,28 +152,16 @@ /** * Evaluates JavaScript code globally * - * Inspired by code by Andrea Giammarchi - * http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - * * @param data {String} JavaScript commands - * @return {void} + * @return {var} Result of the execution */ globalEval : function(data) { - var head = document.getElementsByTagName("head")[0] || document.documentElement; - var script = document.createElement("script"); - - script.type = "text/javascript"; - if (qx.core.Variant.isSet("qx.client", "mshtml")) { - script.text = data; + if (window.execScript) { + return window.execScript(data); } else { - script.appendChild(document.createTextNode(data)); - } - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (see jQuery Bug #2709). - head.insertBefore(script, head.firstChild); - head.removeChild(script); + return eval.call(window, data); + } }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |