From f337ba2bebcbe8f4a8493a482526131e6207bb6d Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Fri, 1 Jun 2012 09:25:29 +0000 Subject: TActiveClientScript: remove scripts from the page after the browser evaluated them --- .../Web/Javascripts/source/prado/scriptaculous-adapter.js | 10 ++++------ framework/Web/UI/ActiveControls/TActiveClientScript.php | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/framework/Web/Javascripts/source/prado/scriptaculous-adapter.js b/framework/Web/Javascripts/source/prado/scriptaculous-adapter.js index 740f9607..2cdc34e6 100644 --- a/framework/Web/Javascripts/source/prado/scriptaculous-adapter.js +++ b/framework/Web/Javascripts/source/prado/scriptaculous-adapter.js @@ -423,16 +423,14 @@ Prado.Element = var content = Prado.Element.extractContent(this.transport.responseText, boundary); if(content == null) return; - var id = 'inline_' + boundary; - - if($(id)) - document.body.removeChild($(id)); var el = document.createElement("script"); el.type = "text/javascript"; - el.id = id; + el.id = 'inline_' + boundary; el.text = content; - document.body.appendChild(el); + + (document.getElementsByTagName('head')[0] || document.documentElement).appendChild(el); + el.parentNode.removeChild(el); }, /** diff --git a/framework/Web/UI/ActiveControls/TActiveClientScript.php b/framework/Web/UI/ActiveControls/TActiveClientScript.php index fba74f4c..d1ed5d3c 100755 --- a/framework/Web/UI/ActiveControls/TActiveClientScript.php +++ b/framework/Web/UI/ActiveControls/TActiveClientScript.php @@ -68,7 +68,6 @@ class TActiveClientScript extends TClientScript if($this->getPage()->getIsCallback()) { $extWriter= $this->getPage()->getResponse()->createHtmlWriter(); - $extWriter->getWriter()->setBoundary($this->ClientID); $extWriter->write("/*renderChildren($extWriter); $extWriter->write("\n/*]]>*/"); -- cgit v1.2.3