<?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: Update Symfony 2 Debug Bar on each ajax call</title>
	<atom:link href="http://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/feed/" rel="self" type="application/rss+xml" />
	<link>http://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/</link>
	<description>just another dev blog</description>
	<lastBuildDate>Tue, 28 May 2013 12:41:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>By: Fernando Arroyo</title>
		<link>http://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/#comment-2156</link>
		<dc:creator><![CDATA[Fernando Arroyo]]></dc:creator>
		<pubDate>Tue, 28 May 2013 12:41:35 +0000</pubDate>
		<guid isPermaLink="false">http://funktion-it.co.za/?p=70#comment-2156</guid>
		<description><![CDATA[What if I&#039;m developing an ajax application and I have a page with a number of ajax requests and I want to debug them all? The provided method overwrites all previous requests, so we end up only with the last one. If you use the following code, the debug bar for each request piles up on top of the previous one, so it might not be super beautiful, but it&#039;s super useful:

$(function() {
    $(document).ajaxComplete(function(event, XMLHttpRequest, ajaxOption) {
        if(XMLHttpRequest.getResponseHeader(&#039;x-debug-token&#039;)) {
            $.get(
                window.location.protocol+&#039;//&#039;+window.location.hostname+&#039;/app_dev.php/_wdt/&#039;+XMLHttpRequest.getResponseHeader(&#039;x-debug-token&#039;),
                function(data) {
                    $(&#039;body&#039;).append(data);
                    $(&#039;.sf-toolbarreset&#039;).each(function(i) {
                        $(this).css(&#039;bottom&#039;, i&gt;0?&#039;+=38px&#039;:&#039;+=0px&#039;);
                    });
                    $(&#039;.sf-minitoolbar&#039;).each(function(i) {
                        $(this).css(&#039;bottom&#039;, i&gt;0?&#039;+=38px&#039;:&#039;+=0px&#039;);
                    });
                }
            );
        }
    });
});]]></description>
		<content:encoded><![CDATA[<p>What if I&#8217;m developing an ajax application and I have a page with a number of ajax requests and I want to debug them all? The provided method overwrites all previous requests, so we end up only with the last one. If you use the following code, the debug bar for each request piles up on top of the previous one, so it might not be super beautiful, but it&#8217;s super useful:</p>
<p>$(function() {<br />
    $(document).ajaxComplete(function(event, XMLHttpRequest, ajaxOption) {<br />
        if(XMLHttpRequest.getResponseHeader(&#8216;x-debug-token&#8217;)) {<br />
            $.get(<br />
                window.location.protocol+&#8217;//&#8217;+window.location.hostname+&#8217;/app_dev.php/_wdt/&#8217;+XMLHttpRequest.getResponseHeader(&#8216;x-debug-token&#8217;),<br />
                function(data) {<br />
                    $(&#8216;body&#8217;).append(data);<br />
                    $(&#8216;.sf-toolbarreset&#8217;).each(function(i) {<br />
                        $(this).css(&#8216;bottom&#8217;, i&gt;0?&#8217;+=38px':&#8217;+=0px&#8217;);<br />
                    });<br />
                    $(&#8216;.sf-minitoolbar&#8217;).each(function(i) {<br />
                        $(this).css(&#8216;bottom&#8217;, i&gt;0?&#8217;+=38px':&#8217;+=0px&#8217;);<br />
                    });<br />
                }<br />
            );<br />
        }<br />
    });<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fernando</title>
		<link>http://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/#comment-2155</link>
		<dc:creator><![CDATA[Fernando]]></dc:creator>
		<pubDate>Tue, 28 May 2013 10:38:51 +0000</pubDate>
		<guid isPermaLink="false">http://funktion-it.co.za/?p=70#comment-2155</guid>
		<description><![CDATA[If you need to see multiple debug bars, one per request (i.e. debugging a page with several ajax requests AND you want to see what happened on every request), one way to display all the generated debug bars is:

$(function() {
    $(document).ajaxComplete(function(event, XMLHttpRequest, ajaxOption) {
        if(XMLHttpRequest.getResponseHeader(&#039;x-debug-token&#039;)) {
            $.get(
                window.location.protocol+&#039;//&#039;+window.location.hostname+&#039;/app_dev.php/_wdt/&#039;+XMLHttpRequest.getResponseHeader(&#039;x-debug-token&#039;),
                function(data) {
                    $(&#039;body&#039;).append(data);
                    $(&#039;.sf-toolbarreset&#039;).each(function(i) {
                        $(this).css(&#039;bottom&#039;, i&gt;0?&#039;+=38px&#039;:&#039;+=0px&#039;);
                    });
                    $(&#039;.sf-minitoolbar&#039;).each(function(i) {
                        $(this).css(&#039;bottom&#039;, i&gt;0?&#039;+=38px&#039;:&#039;+=0px&#039;);
                    });
                }
            );
        }
    });
});]]></description>
		<content:encoded><![CDATA[<p>If you need to see multiple debug bars, one per request (i.e. debugging a page with several ajax requests AND you want to see what happened on every request), one way to display all the generated debug bars is:</p>
<p>$(function() {<br />
    $(document).ajaxComplete(function(event, XMLHttpRequest, ajaxOption) {<br />
        if(XMLHttpRequest.getResponseHeader(&#8216;x-debug-token&#8217;)) {<br />
            $.get(<br />
                window.location.protocol+&#8217;//&#8217;+window.location.hostname+&#8217;/app_dev.php/_wdt/&#8217;+XMLHttpRequest.getResponseHeader(&#8216;x-debug-token&#8217;),<br />
                function(data) {<br />
                    $(&#8216;body&#8217;).append(data);<br />
                    $(&#8216;.sf-toolbarreset&#8217;).each(function(i) {<br />
                        $(this).css(&#8216;bottom&#8217;, i&gt;0?&#8217;+=38px':&#8217;+=0px&#8217;);<br />
                    });<br />
                    $(&#8216;.sf-minitoolbar&#8217;).each(function(i) {<br />
                        $(this).css(&#8216;bottom&#8217;, i&gt;0?&#8217;+=38px':&#8217;+=0px&#8217;);<br />
                    });<br />
                }<br />
            );<br />
        }<br />
    });<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Schnaaf</title>
		<link>http://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/#comment-2010</link>
		<dc:creator><![CDATA[Schnaaf]]></dc:creator>
		<pubDate>Sun, 12 May 2013 08:08:02 +0000</pubDate>
		<guid isPermaLink="false">http://funktion-it.co.za/?p=70#comment-2010</guid>
		<description><![CDATA[As of jQuery 1.8, the .ajaxComplete() method should only be attached to document.

To prevent the error - TypeError: XMLHttpRequest is undefined - I changed:

$(&quot;body&quot;).ajaxComplete

in:
$(document).ajaxComplete

Great snippet indeed!]]></description>
		<content:encoded><![CDATA[<p>As of jQuery 1.8, the .ajaxComplete() method should only be attached to document.</p>
<p>To prevent the error &#8211; TypeError: XMLHttpRequest is undefined &#8211; I changed:</p>
<p>$(&#8220;body&#8221;).ajaxComplete</p>
<p>in:<br />
$(document).ajaxComplete</p>
<p>Great snippet indeed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sacheen Dhanjie</title>
		<link>http://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/#comment-1517</link>
		<dc:creator><![CDATA[Sacheen Dhanjie]]></dc:creator>
		<pubDate>Wed, 06 Mar 2013 10:44:37 +0000</pubDate>
		<guid isPermaLink="false">http://funktion-it.co.za/?p=70#comment-1517</guid>
		<description><![CDATA[Hi,

In my development environment, when developing i use the .htaccess to control the application environment,
thus eradicating the need to add the app_dev.php, also when in production mode, we don&#039;t really want to show the debug bar :-D]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>In my development environment, when developing i use the .htaccess to control the application environment,<br />
thus eradicating the need to add the app_dev.php, also when in production mode, we don&#8217;t really want to show the debug bar :-D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bence Meszaros</title>
		<link>http://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/#comment-790</link>
		<dc:creator><![CDATA[Bence Meszaros]]></dc:creator>
		<pubDate>Thu, 17 Jan 2013 15:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://funktion-it.co.za/?p=70#comment-790</guid>
		<description><![CDATA[Brilliant idea! It is a must have, if you develop ajax apps.

I only have one small comment. At symfony 2.1 its better to remove the .sf-toolbar div:

$(&#039;.sf-toolbar&#039;).remove()

And maybe meaningful to call the app_dev.php instead of the prod environment:

... +window.location.hostname+&#039;/app_dev.php/_wdt/&#039;+ ...]]></description>
		<content:encoded><![CDATA[<p>Brilliant idea! It is a must have, if you develop ajax apps.</p>
<p>I only have one small comment. At symfony 2.1 its better to remove the .sf-toolbar div:</p>
<p>$(&#8216;.sf-toolbar&#8217;).remove()</p>
<p>And maybe meaningful to call the app_dev.php instead of the prod environment:</p>
<p>&#8230; +window.location.hostname+&#8217;/app_dev.php/_wdt/&#8217;+ &#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
