<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dented Reality &#187; javascript</title>
	<atom:link href="http://dentedreality.com.au/tags/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://dentedreality.com.au</link>
	<description>Beau Lebens throws down his opinion on all sorts of things he doesn&#039;t know too much about.</description>
	<lastBuildDate>Tue, 15 May 2012 07:24:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-beta4-20800</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Closing a Window in JavaScript</title>
		<link>http://dentedreality.com.au/2012/05/close-window-javascript/</link>
		<comments>http://dentedreality.com.au/2012/05/close-window-javascript/#comments</comments>
		<pubDate>Tue, 08 May 2012 17:21:12 +0000</pubDate>
		<dc:creator>Beau Lebens</dc:creator>
				<category><![CDATA[Techn(ical|ology)]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://dentedreality.com.au/?p=8094</guid>
		<description><![CDATA[If you&#8217;re having trouble closing a window using JavaScript, this might help. I&#8217;ve had this problem sometimes in Chrome in particular when I open a window, then follow through a bunch of redirects or something. It seems to lose track of the fact that I &#8220;control&#8221; this window object, so it doesn&#8217;t allow me to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re having trouble closing a window using JavaScript, this might help. I&#8217;ve had this problem sometimes in Chrome in particular when I open a window, then follow through a bunch of redirects or something. It seems to lose track of the fact that I &#8220;control&#8221; this window object, so it doesn&#8217;t allow me to close it. This fixes that:</p>
<pre>window.open('', '_self', '');
window.close();</pre>
<p>Basically it reopens the window on itself, then immediately closes itself. Neat. Haven&#8217;t had any problems with it not working in other browsers, but I also haven&#8217;t super-widely tested it.</p>
]]></content:encoded>
			<wfw:commentRss>http://dentedreality.com.au/2012/05/close-window-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>HOW TO: Remove Digg&#8217;s new DiggBar from your website</title>
		<link>http://dentedreality.com.au/2009/04/how-to-remove-the-new-diggbar-from-your-website/</link>
		<comments>http://dentedreality.com.au/2009/04/how-to-remove-the-new-diggbar-from-your-website/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 17:55:49 +0000</pubDate>
		<dc:creator>Beau Lebens</dc:creator>
				<category><![CDATA[Techn(ical|ology)]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[diggbar]]></category>
		<category><![CDATA[frames]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://dentedreality.com.au/?p=1012</guid>
		<description><![CDATA[So Digg have released their wonderful new DiggBar product, to a lot of fanfare, excitement and, well&#8230; criticism. I&#8217;ll let other people cover each angle. In the meantime, if you want to prevent your site from being loaded with the DiggBar, just drop this code into the top of your page (or in an external [...]]]></description>
			<content:encoded><![CDATA[<p>So <a href="http://digg.com/">Digg</a> have released their wonderful new <a href="http://digg.com/tools/diggbar">DiggBar</a> product, to a lot of <a href="http://www.techcrunch.com/2009/04/02/diggs-toolbar-is-here-go-shorten-those-urls/">fanfare</a>, excitement and, well&#8230; <a href="http://blog.wired.com/business/2009/04/diggbar-digs-up.html">criticism</a>. I&#8217;ll let other people cover each angle. In the meantime, if you want to prevent your site from being loaded with the DiggBar, just drop this code into the top of your page (or in an external JavaScript file if you already have one that loads on every page):</p>
<pre>&lt;script type="text/javascript" language="JavaScript"&gt;
// Break out of frames
if (top.location != location) {
    top.location.href = document.location.href ;
}
&lt;/script&gt;</pre>
<p>Basically, it just compares the current document (in this case your website) to the &#8220;top&#8221; document available in the browser. If your site has been loaded via the DiggBar then the &#8220;top&#8221; document will be Digg, so they will be different. When those 2 documents are different, it will automatically redirect the entire browser to your website. Done and done.</p>
]]></content:encoded>
			<wfw:commentRss>http://dentedreality.com.au/2009/04/how-to-remove-the-new-diggbar-from-your-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>HOWTO: Implement Facebook Connect on WordPress (in reality)</title>
		<link>http://dentedreality.com.au/2008/12/implementing-facebook-connect-on-wordpress-in-reality/</link>
		<comments>http://dentedreality.com.au/2008/12/implementing-facebook-connect-on-wordpress-in-reality/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 23:05:22 +0000</pubDate>
		<dc:creator>Beau Lebens</dc:creator>
				<category><![CDATA[Clients]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Techn(ical|ology)]]></category>
		<category><![CDATA[@morganb]]></category>
		<category><![CDATA[blownmortgage.com]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook connect]]></category>
		<category><![CDATA[fb connect]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[resumedonkey.com]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://dentedreality.com.au/?p=798</guid>
		<description><![CDATA[2008-12-23: There were a number of problems with the code samples in this post previously due to some WordPress formatting problems. They are all corrected now, and you should be able to follow through this post and get this working on your own blog quite easily. 2008-12-26: Fixed a bug that caused the JS to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>2008-12-23: There were a number of problems with the code samples in this post previously due to some WordPress formatting problems. They are all corrected now, and you should be able to follow through this post and get this working on your own blog quite easily.</strong></p>
<p><strong>2008-12-26: Fixed a bug that caused the JS to overwrite details on a non-FB Connect comment as well. Also changed the fake email address that&#8217;s stored to include the user&#8217;s FB user ID.<br />
</strong></p>
<p>In case you&#8217;ve been living under a no-technology-news rock for the last few weeks, you&#8217;ll know that <a href="http://developers.facebook.com/news.php?blog=1&amp;story=108">Facebook Connect</a> was released recently. I had been seeing/hearing a lot about it, including <a href="http://mashable.com/2008/12/11/facebook-connect-blog/">this video at Mashable</a>, showing how to implement FB Connect in 8 minutes. So when my friend <a href="http://blownmortgage.com/">Morgan from BlownMortgage</a> asked me if I&#8217;d be able to help him implement it on his new resume-editing site <a href="http://resumedonkey.com/">ResumeDonkey.com</a>, I figured &#8220;how hard could it be&#8221; and said yes. Although it definitely didn&#8217;t take 8 minutes, I got it done, so I thought I&#8217;d post some details on the specific approach I used for ResumeDonkey.com.</p>
<p><span id="more-798"></span>Before I rolled my own solution, I took a good look at a few of the existing WordPress options including:</p>
<ul>
<li>The <a href="http://wiki.developers.facebook.com/index.php/WP-FBConnect">WP-FBConnect plugin</a>, made by Facebook,</li>
<li>Another <a href="http://www.sociable.es/facebook-connect/">WordPress plugin made by Sociable</a>, and</li>
<li>The <a href="http://staynalive.com/the-community-facebook-connect-plugin/">Community Facebook Connect Plugin</a>, by Jesse Stay</li>
</ul>
<p>None of these worked quite how Morgan and I had discussed, so I decided to make my own, lightweight solution. Before editing any actual theme files, there&#8217;s some prep-work to be done, so:</p>
<ol>
<li>Log into Facebook and then go and add the <a href="http://www.facebook.com/developers/">Facebook Developers Application</a></li>
<li>Click the big button at the top right to Set Up a New Application</li>
<li>Enter a name and agree to the terms (you read them all, right?)</li>
<li>On the next page, enter the base URL of your website in the &#8220;Callback URL&#8221; field. MAKE SURE you use the correct preference for your website as far as www. or no www. is concerned, and preferably enforce that on your website using a plugin or something. If you enter http://www.domain.com here, and someone accesses your site as http://domain.com, then your FB Connect integration will break and throw a warning about being on the wrong URL.</li>
<li>You can also set some sexy icons/logos to appear in the News Feed of people who comment on your blog, but I&#8217;ll let you handle that.</li>
<li>Get a copy of the &#8220;API Key&#8221; at the top of this page, you&#8217;ll need that later.</li>
</ol>
<p>OK, now we need to register a &#8220;template bundle&#8221;, which will be used to post updates to the News Feed of people who comment on your blog.</p>
<ol>
<li>Go to the <a href="http://www.facebook.com/developers/apps.php">list of your Facebook Apps</a> and click on the app we just created on the left</li>
<li>Click &#8220;Create Feed Template&#8221; in the list of links on the right</li>
<li>Make sure your correct App is selected in the box, then click Next</li>
<li>In the &#8220;One Line Template&#8221; box, paste this exact text
<pre>{*actor*} commented on the {*blog*} post {*post*}.</pre>
</li>
<li>In the &#8220;Sample Template Data&#8221; box, paste this (make sure quote marks are still  quotes and not fancy curly-quotes)
<pre>{"blog":"&lt;a href='http://test.domain.com'&gt;My Blog Name&lt;/a&gt;", "post":"&lt;a href='http://test.domain.com/post-url/'&gt;Test Post Title&lt;/a&gt;"}</pre>
</li>
<li>Click Update Preview and make sure that you&#8217;re happy with the News Feed format (if not, change the One Line Template string)</li>
<li>Click Next</li>
<li>Now click Skip (and ignore/Okay any errors) until you get to the final page and then click &#8220;Register Template Bundle&#8221;</li>
<li>It will give you a Template Bundle ID, and you&#8217;ll want to get a copy of that, because we&#8217;ll need it later as well.</li>
</ol>
<p>OK. Now you&#8217;ve got a registered and configured (roughly) App on Facebook, time to get dirty on your own blog. Create a file in the root of your domain and call it &#8220;xd_receiver.htm&#8221;, then copy the following code into it:</p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;Cross-Domain Receiver Page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script src="http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Add the &#8220;fb&#8221; XML namespace to the header.php file in your theme. Mine ended up looking like this (in PHP):</p>
<pre>&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" &lt;?php language_attributes(); ?&gt;&gt;</pre>
<p>And also drop in a reference to jQuery if you don&#8217;t already use it in your theme. It&#8217;s bundled with WordPress so you can reference it like this (anywhere before the call to &#8220;wp_head()&#8221; in your header.php):</p>
<pre>&lt;?php wp_enqueue_script('jquery'); ?&gt;</pre>
<p>Then you&#8217;ll want to edit comments.php (assuming you&#8217;re using a relatively normal theme), and make some changes to add the FB Connect button. Find the part where a user would normally enter their name/email/URL and change it to look something like this:</p>
<pre>&lt;div id="comment-user-details"&gt;
&lt;fb:login-button length="long" onlogin="update_user_details();"&gt;&lt;/fb:login-button&gt;

&lt;p style="clear:left;"&gt;&lt;strong&gt;Or enter your details below:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;label for="name"&gt;Name &lt;?php if ($req) echo "(required)"; ?&gt;&lt;/label&gt;&lt;br /&gt;
&lt;input type="text" name="author" id="name" value="&lt;?php echo $comment_author; ?&gt;" size="50" tabindex="1" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;label for="email"&gt;Email Address &lt;?php if ($req) echo "(required)"; ?&gt;&lt;/label&gt;&lt;br /&gt;
&lt;input type="text" name="email" id="email" value="&lt;?php echo $comment_author_email; ?&gt;" size="50" tabindex="2" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;label for="url"&gt;Website&lt;/label&gt;&lt;br /&gt;
&lt;input type="text" name="url" id="url" value="&lt;?php echo $comment_author_url; ?&gt;" size="50" tabindex="3" /&gt;&lt;/p&gt;
&lt;/div&gt;</pre>
<p>Just above this block, you should also find the start of the &lt;form&gt; tag for posting a comment, you want to add the &#8220;onsubmit&#8221; attribute to it so that it looks something like this:</p>
<pre>&lt;form action="&lt;?php echo get_option('siteurl'); ?&gt;/wp-comments-post.php" method="post" id="commentform" onsubmit="update_form_values();"&gt;</pre>
<p>The important parts there are that it&#8217;s all wrapped in a DIV or SPAN with id=&#8221;comment-user-details&#8221; and then obviously the &lt;fb:login-button&gt; stuff. Now further down (I went right down to the bottom of the comments.php file actually), add this code:</p>
<pre>&lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"&gt;&lt;/script&gt;
&lt;style type="text/css"&gt;
#fb-user { border: 1px dotted #C0C0C0; padding: 5px; display: block; height: 48px; }
#fb-msg { float:left; }
.fb_profile_pic_rendered { margin-right: 5px; }
a.FB_Link img { float: left; }
&lt;/style&gt;

&lt;script type="text/javascript"&gt;
var fb_connect_user = false;
function update_user_details() {
fb_connect_user = true;
// Show their FB details
if (!jQuery('#fb-user').length) {
jQuery('#comment-user-details').hide().after("&lt;span id='fb-user'&gt;" +
"&lt;fb:profile-pic uid='loggedinuser' facebook-logo='true'&gt;&lt;/fb:profile-pic&gt;" +
"&lt;span id='fb-msg'&gt;&lt;strong&gt;Hi &lt;fb:name uid='loggedinuser' useyou='false'&gt;&lt;/fb:name&gt;!&lt;/strong&gt;&lt;br /&gt;You are logged in with your Facebook account. " +
"&lt;a href='#' onclick='FB.Connect.logoutAndRedirect(\"&lt;?php the_permalink() ?&gt;\"); return false;'&gt;Logout&lt;/a&gt;" +
"&lt;/span&gt;&lt;/span&gt;");
}

// Refresh the DOM
FB.XFBML.Host.parseDomTree();
}

function update_form_values() {
if (fb_connect_user) {
profile = jQuery('#fb-user').find('.FB_ElementReady .FB_Link')[1]['href'];
user_id = profile.substring(profile.indexOf('?id=')+4);
jQuery('#url').val(profile); // FB profile URL
jQuery('#email').val(user_id+'@facebook.com'); // Can't get a real one from FB unfortunately. This saves their user id @facebook.com
jQuery('#fb-user').find('.FB_ElementReady .FB_Link').each(function(i){ if (i==1) { jQuery('#name').val(jQuery(this).text()); } }); // Gets their name from the DOM
setCookie('fb_connect', 'yes');
}
}

function setCookie(c_name,value,expiredays) {
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name) {
if (document.cookie.length&gt;0) {
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1) {
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}

FB.init("YOUR-FACEBOOK-API-KEY", "/xd_receiver.htm");
FB.Connect.ifUserConnected(update_user_details);
if (getCookie('fb_connect') == 'yes') {
setCookie('fb_connect', null);
FB.Connect.showFeedDialog(YOUR-TEMPLATE-BUNDLE-ID, {'blog':'&lt;a href="&lt;?php bloginfo('home') ?&gt;"&gt;&lt;?php addslashes(bloginfo('name')) ?&gt;&lt;/a&gt;', 'post':'&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php addslashes(the_title()) ?&gt;&lt;/a&gt;'}, null, null, null, FB.RequireConnect.promptConnect);
}
&lt;/script&gt;</pre>
<p>For those of you paying any attention to what you&#8217;re copy-pasting, you would have noticed that there are 2 important things you need to replace in that last block of code. Go back now and replace &#8220;YOUR-FACEBOOK-API-KEY&#8221; and &#8220;YOUR-TEMPLATE-BUNDLE-ID&#8221; with the appropriate values from the beginning of this process. YOUR-FACEBOOK-API-KEY should be replaced with the 32-character string from the Facebook App config, and <strong>should</strong> include double-quotes around it in the code above. The YOUR-TEMPLATE-BUNDLE-ID should <strong>not</strong> have quotes around it.</p>
<p>Save everything and upload it (if you were working offline). If all has gone well, you should now get a FB Connect button on your comments (you need to log out of WordPress to see it), and when you click it, you should connect to FB, then be able to post a comment.</p>
<p>When a Facebook user comments on your blog now, their name will be loaded from Facebook, their profile URL will be used as their URL, and the email address will be recorded as &#8220;user@facebook.com&#8221; (their API doesn&#8217;t allow you to actually get it, to avoid spam I assume).</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://dentedreality.com.au/2008/12/implementing-facebook-connect-on-wordpress-in-reality/feed/</wfw:commentRss>
		<slash:comments>153</slash:comments>
	
	</item>
		<item>
		<title>Resizing Browser Windows With JavaScript</title>
		<link>http://dentedreality.com.au/2005/12/resizing-browser-windows-with-javascript/</link>
		<comments>http://dentedreality.com.au/2005/12/resizing-browser-windows-with-javascript/#comments</comments>
		<pubDate>Wed, 14 Dec 2005 01:03:00 +0000</pubDate>
		<dc:creator>Beau Lebens</dc:creator>
				<category><![CDATA[Techn(ical|ology)]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[browser window]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[resize]]></category>

		<guid isPermaLink="false">http://wiggin.local/dev/dentedreality.com.au/2005/12/resizing-browser-windows-with-javascript/</guid>
		<description><![CDATA[So here&#8217;s an annoying one &#8211; I wanted to resize my browser window automatically, after the page had loaded (in a dynamic pop-up), to meet certain size requirements (namely to match a background image). The problem that I had was that all the different browsers support different methods and properties in relation to the &#8216;viewport&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>So here&#8217;s an annoying one &#8211; I wanted to resize my browser window automatically, after the page had loaded (in a dynamic pop-up), to meet certain size requirements (namely to match a background image). The problem that I had was that all the different browsers support different methods and properties in relation to the &#8216;viewport&#8217; (visible area of the browser), so I was having trouble finding a reliable way to do this.</p>
<p>I found a <a title="View article on 'Viewport Properties'" href="http://www.quirksmode.org/viewport/compatibility.html">great breakdown</a> over at <a title="Go to quirksmode.org" href="http://www.quirksmode.org/">quirksmode.org</a>, but it didn&#8217;t actually work in Safari (2.0.2), so I found that out pretty quickly, because that&#8217;s what I&#8217;m working in. After a little playing around, I came up with the following modifications, which calculates the amount of chrome visible in the currrent window, and then takes that into account when resizing the entire window size.</p>
<p>I haven&#8217;t tested this on too much other than Safari and Firefox on a Mac, but I think it should be reasonably compatible with others.</p>
<pre>// Viewable size you want once resized
x = 600;
y = 400;

// Now set the window size for different browser types
// all except Explorer
if (self.innerHeight) {
	// Figure out the measurements
	iX = self.innerWidth;
	iY = self.innerHeight;
	oX = self.outerWidth;
	oY = self.outerHeight;

	// And resize to match the desired target
	gX = oX - iX;
	gY = oY - iY;
	window.resizeTo(x + gX, y + gY)
}
// Explorer 6 Strict Mode
else if (document.documentElement &amp;&amp; document.documentElement.clientHeight) {
	document.documentElement.clientWidth = x;
	document.documentElement.clientHeight = y;
}
// other Explorers
else if (document.body) {
	document.body.clientWidth = x;
	document.body.clientHeight = y;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://dentedreality.com.au/2005/12/resizing-browser-windows-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Google Maps Bookmarklet</title>
		<link>http://dentedreality.com.au/2005/12/google-maps-bookmarklet/</link>
		<comments>http://dentedreality.com.au/2005/12/google-maps-bookmarklet/#comments</comments>
		<pubDate>Tue, 13 Dec 2005 04:40:00 +0000</pubDate>
		<dc:creator>Beau Lebens</dc:creator>
				<category><![CDATA[Techn(ical|ology)]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mapping]]></category>

		<guid isPermaLink="false">http://wiggin.local/dev/dentedreality.com.au/2005/12/google-maps-bookmarklet/</guid>
		<description><![CDATA[I&#8217;m sick of Cmd-T, maps.google.com, Enter, &#8216;address&#8217; + &#8216;, sf, ca&#8217; so I made this quick little bookmarklet to speed up the process a little. Drag it to your bookmark toolbar, then click it, enter a street address (eg. &#8217;2000 Bush St&#8217;) and hit &#8216;Ok&#8217; to get an instant Google Map to that location in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sick of Cmd-T, maps.google.com, Enter, &#8216;address&#8217; + &#8216;, sf, ca&#8217; so I made this quick little bookmarklet to speed up the process a little.</p>
<p>Drag it to your bookmark toolbar, then click it, enter a street address (eg. &#8217;2000 Bush St&#8217;) and hit &#8216;Ok&#8217; to get an instant Google Map to that location in San Francisco (my current hometown).</p>
<p><a href="javascript:void(document.location.href='http://maps.google.com/maps?iwloc=A&amp;hl=en&amp;q='+escape(prompt('Enter Street Address in San Francisco:',''))+',+San+Francisco,+California');">map</a></p>
<p>Obviously editing this to work for different cities in the US would be trivial &#8211; knock yourselves out.</p>
]]></content:encoded>
			<wfw:commentRss>http://dentedreality.com.au/2005/12/google-maps-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Useful JavaScript Snippet</title>
		<link>http://dentedreality.com.au/2004/01/useful-javascript-snippet/</link>
		<comments>http://dentedreality.com.au/2004/01/useful-javascript-snippet/#comments</comments>
		<pubDate>Wed, 14 Jan 2004 11:48:00 +0000</pubDate>
		<dc:creator>Beau Lebens</dc:creator>
				<category><![CDATA[Techn(ical|ology)]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[in_array]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://wiggin.local/dev/dentedreality.com.au/2004/01/useful-javascript-snippet/</guid>
		<description><![CDATA[One of the coolest things in the PHP programming language is its excellent handling of arrays. The same, sadly, cannot be said for JavaScript This small JavaScript function implements one of the cool functions available in PHP, making it easier to store things in an array, and then check to see if they&#8217;re in there [...]]]></description>
			<content:encoded><![CDATA[<p>One of the coolest things in the PHP programming language is its excellent handling of arrays. The same, sadly, cannot be said for JavaScript <img src='http://dentedreality.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This small JavaScript function implements one of the cool functions available in PHP, making it easier to store things in an array, and then check to see if they&#8217;re in there later.</p>
<pre>// Returns true or false based on whether the specified string is found
// in the array. This is based on the PHP function of the same name.
// Written by Beau Lebens
function in_array(stringToSearch, arrayToSearch) {
	for (s = 0; s &lt; arrayToSearch.length; s++) {
		thisEntry = arrayToSearch[s].toString();
		if (thisEntry == stringToSearch) {
			return true;
		}
	}
	return false;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://dentedreality.com.au/2004/01/useful-javascript-snippet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
	</channel>
</rss>

