<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Zend_View_Helper_InlineScript Appends Scripts Twice</title>
	<atom:link href="/2010/06/30/zend_view_helper_inlinescript-appends-scripts-twice/feed/" rel="self" type="application/rss+xml" />
	<link>/2010/06/30/zend_view_helper_inlinescript-appends-scripts-twice/</link>
	<description>on web development</description>
	<lastBuildDate>Fri, 26 Oct 2018 21:40:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>By: Stoimen</title>
		<link>/2010/06/30/zend_view_helper_inlinescript-appends-scripts-twice/comment-page-1/#comment-14154</link>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
		<pubDate>Sat, 15 Jan 2011 11:57:40 +0000</pubDate>
		<guid isPermaLink="false">/?p=1736#comment-14154</guid>
		<description><![CDATA[You may try with a newer version of the framework!]]></description>
		<content:encoded><![CDATA[<p>You may try with a newer version of the framework!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christof Coetzee</title>
		<link>/2010/06/30/zend_view_helper_inlinescript-appends-scripts-twice/comment-page-1/#comment-14153</link>
		<dc:creator><![CDATA[Christof Coetzee]]></dc:creator>
		<pubDate>Fri, 14 Jan 2011 20:53:51 +0000</pubDate>
		<guid isPermaLink="false">/?p=1736#comment-14153</guid>
		<description><![CDATA[I had the same issue and its really annoying.

I used a solution which is also not that great, but at least one don&#039;t have to alter the core files.

create an array and store the added code in it, then every time before calling the script object first check if it was already added.

Something like this:
&lt;pre lang=&quot;php&quot; escaped=&quot;true&quot;&gt;
if(!in_array($jsCode, $this-&#062;inlineScriptBugFixArray)){

        $scripts-&#062;headScript(&#039;SCRIPT&#039;, $jsCode);
	$this-&#062;inlineScriptBugFixArray[]=$jsCode;
}
&lt;/pre&gt;
and the above will obviously be inside a method that can be called every time a script needs to be added, ensuring its unique everytime, at the cost of some memory for storing $jsCode in the array.]]></description>
		<content:encoded><![CDATA[<p>I had the same issue and its really annoying.</p>
<p>I used a solution which is also not that great, but at least one don&#8217;t have to alter the core files.</p>
<p>create an array and store the added code in it, then every time before calling the script object first check if it was already added.</p>
<p>Something like this:</p>
<pre lang="php" escaped="true">
if(!in_array($jsCode, $this-&gt;inlineScriptBugFixArray)){

        $scripts-&gt;headScript('SCRIPT', $jsCode);
	$this-&gt;inlineScriptBugFixArray[]=$jsCode;
}
</pre>
<p>and the above will obviously be inside a method that can be called every time a script needs to be added, ensuring its unique everytime, at the cost of some memory for storing $jsCode in the array.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
