<?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>deconcept &#187; safari</title>
	<atom:link href="http://blog.deconcept.com/category/safari/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.deconcept.com</link>
	<description>You&#039;ve got your good thing, and I&#039;ve got mine</description>
	<lastBuildDate>Mon, 30 Jan 2012 16:14:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Safari&#8217;s hidden debug menu</title>
		<link>http://blog.deconcept.com/2005/07/28/safaris-hidden-debug-menu/</link>
		<comments>http://blog.deconcept.com/2005/07/28/safaris-hidden-debug-menu/#comments</comments>
		<pubDate>Fri, 29 Jul 2005 04:57:08 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://blog.deconcept.com/2005/07/28/safaris-hidden-debug-menu/</guid>
		<description><![CDATA[Trouble debugging your Javascript in Safari? Me too! That&#8217;s why I found this little tip useful (notice I say &#8216;useful&#8217; and not &#8216;very useful&#8217;). Safari is usually a very large pain when building Javascript apps. There are many small issues &#8230; <a href="http://blog.deconcept.com/2005/07/28/safaris-hidden-debug-menu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Trouble debugging your Javascript in Safari? Me too! That&#8217;s why I found this little tip useful (notice I say &#8216;useful&#8217; and not &#8216;very useful&#8217;).</p>
<p>Safari is usually a very large pain when building Javascript apps. There are many <a href="http://blog.deconcept.com/2005/03/25/safari-and-links-to-elements-in-overflow-auto-content">small issues</a> that seem to pop up all the time. But now with the release of Safari 2.0, you have a bit of help. Safari now has a Javascript console! It&#8217;s nothing fancy, and the errors it shows are sometimes less than optimal, but it&#8217;s far better than just guessing randomly at the problem.</p>
<p>To enable the Javascript console, first you must enable Safari&#8217;s debug menu. Do this by opening your Terminal and inputting this line:<br />
<code>
<pre>defaults write com.apple.Safari IncludeDebugMenu 1</pre>
<p></code></p>
<p>Now the next time you start Safari, you&#8217;ll have an extra menu up top called &#8220;Debug&#8221; and inside are all kinds of goodies. Here&#8217;s what the menu looks like:</p>
<p><img src="http://blog.deconcept.com/images/2005/07/safari_debug_menu.gif" alt="Safari debug menu" /></p>
<p>Back to the original point of this post, one of the items is &#8220;Show JavaScript Console&#8221; and selecting that item opens up this little window:</p>
<p><img src="http://blog.deconcept.com/images/2005/07/safari_js_console.gif" alt="Safari Javascript Console" /></p>
<p>It&#8217;s not nearly as sleek and useful as the Firefox/Mozilla Javascript console, but it&#8217;s a step in the right direction, and definitely better than nothing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deconcept.com/2005/07/28/safaris-hidden-debug-menu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Safari and links to elements in overflow:auto content</title>
		<link>http://blog.deconcept.com/2005/03/25/safari-and-links-to-elements-in-overflow-auto-content/</link>
		<comments>http://blog.deconcept.com/2005/03/25/safari-and-links-to-elements-in-overflow-auto-content/#comments</comments>
		<pubDate>Sat, 26 Mar 2005 02:26:57 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://blog.deconcept.com/2005/03/25/safari-and-links-to-elements-in-overflow-auto-content/</guid>
		<description><![CDATA[I&#8217;m working on a project right now that has some content in div tags with their overflow property set to auto. Then, on another part of the page, there are links that point to elements (using their IDs) inside the &#8230; <a href="http://blog.deconcept.com/2005/03/25/safari-and-links-to-elements-in-overflow-auto-content/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a project right now that has some content in <code>div</code> tags with their <code>overflow</code> property set to <code>auto</code>. Then, on another part of the page, there are links that point to elements (using their IDs) inside the overflowed <code>div</code> tags (<a href="/code/overflowsafari/overflowsafari.html">See example</a>). This all works just fine in IE6 and Firefox/Mozilla, but Safari wasn&#8217;t behaving. You can click the links all day long, but Safari won&#8217;t scroll the selected anchor into view.</p>
<p>Well, after a few hours of tyring different ways to hack Safari into submission, I decided that the only way I could get it working was to use some Javascript, so I thought I should share the code since there were a few pages on Google also looking for solutions.</p>
<p>Here is what the Javascript looks like:</p>
<pre><code>var targBox = "box";
function init() {
	if (document.getElementById) {
		var atags = document.getElementsByTagName("A");
		for (var i=0;i&lt;atags.length;i++) {
			var ca = atags[i];
			if (ca.href.indexOf("#") &gt; -1) {
				ca.onclick = function() {
					scrollDivToAnchor(this.href.split("#")[1]);
				}
			}
		}
	}
}
function scrollDivToAnchor(a) {
	var b = document.getElementById(targBox);
	b.scrollTop = document.getElementById(a).offsetTop - b.offsetTop;
}
</code></pre>
<p>Sample page with the working code:</p>
<p><a href="/code/overflowsafari/overflowsafarijs.html">View Example</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deconcept.com/2005/03/25/safari-and-links-to-elements-in-overflow-auto-content/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>

