<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Über Software &#187; debugging</title>
	<atom:link href="http://www.uebersoftware.com/category/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.uebersoftware.com</link>
	<description>Opinions and thoughts on Software and Technology.</description>
	<lastBuildDate>Thu, 29 Apr 2010 06:04:30 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FB Series: AJAX &amp; Facebook debugging</title>
		<link>http://www.uebersoftware.com/2009/08/fb-series-ajax-and-facebook-debugging/</link>
		<comments>http://www.uebersoftware.com/2009/08/fb-series-ajax-and-facebook-debugging/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 16:25:45 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[debugging]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=43</guid>
		<description><![CDATA[The php facebook client has a nice setting to track the different http calls between your app and facebook. You can enable this with:
$GLOBALS['facebook_config']['debug'] = true;
This will actually insert some script code to the header of every page served, in order to render the tracking code, if there is something to render:


&#60;script type="text/javascript"&#62;
var types = [...]]]></description>
			<content:encoded><![CDATA[<p>The php facebook client has a nice setting to track the different http calls between your app and facebook. You can enable this with:</p>
<p><code>$GLOBALS['facebook_config']['debug'] = true;</code></p>
<p>This will actually insert some script code to the header of every page served, in order to render the tracking code, if there is something to render:<br />
<code><br />
</code></p>
<pre id="line1">&lt;<span>script</span><span> type</span>=<span>"text/javascript"</span>&gt;
var types = ['params', 'xml', 'php', 'sxml'];
function getStyle(elem, style) {
  if (elem.getStyle) {
    return elem.getStyle(style);
  } else {
    return elem.style[style];
  }
}
function setStyle(elem, style, value) {
  if (elem.setStyle) {
    elem.setStyle(style, value);
  } else {
    elem.style[style] = value;
  }
}
function toggleDisplay(id, type) {
  for (var i = 0; i &lt; types.length; i++) {
    var t = types[i];
    var pre = document.getElementById(t + id);
    if (pre) {
      if (t != type || getStyle(pre, 'display') == 'block') {
        setStyle(pre, 'display', 'none');
      } else {
        setStyle(pre, 'display', 'block');
      }
    }
  }
  return false;
}
&lt;/<span>script</span>&gt;</pre>
<p>The catch is that the script code is always inserted, even if there were no facebook api calls involved. So the script code renders at the top for every page, also when its a JSON AJAX response. This means of course that the JSON will not be parsed on the browse &#8211; not good.</p>
<p>I now use other tools to track what requests are being sent back and forth instead between my application and facebook.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/08/fb-series-ajax-and-facebook-debugging/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
