<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title> &#187; JavaScript</title>
	<atom:link href="http://australiansearchengine.wordpress.com/category/programming/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://australiansearchengine.wordpress.com</link>
	<description>The idea behind clickfind is simple: connect businesses with customers.</description>
	<lastBuildDate>Fri, 01 Jan 2010 10:45:02 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='australiansearchengine.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/b002f370e2fcbf8ccbdb685d0196c486?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title> &#187; JavaScript</title>
		<link>http://australiansearchengine.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://australiansearchengine.wordpress.com/osd.xml" title="" />
		<item>
		<title>Password Value as Text</title>
		<link>http://australiansearchengine.wordpress.com/2009/11/17/password-value-as-text/</link>
		<comments>http://australiansearchengine.wordpress.com/2009/11/17/password-value-as-text/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 01:53:40 +0000</pubDate>
		<dc:creator>Taco Fleur</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[password value]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://australiansearchengine.wordpress.com/?p=289</guid>
		<description><![CDATA[I was working on a design the other day that only had text fields with no labels, the label was in the text field and would disappear when clicked on<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=australiansearchengine.wordpress.com&blog=2413165&post=289&subd=australiansearchengine&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was working on a design the other day that only had text fields with no labels, the label was in the text field and would disappear when clicked on. Then I came to the password fields and was a little stumped as how to solve this, as any value in a password field is displayed as dots, not text.</p>
<p>I was thinking about using an overlay, but that got too complicated. I figured out a way to do this with JavaScript, basically write a function that on page load converts all password fields to text, but when they get focus they are cleared and the type is set back to type &#8220;password&#8221;. It worked like a charm.</p>
<p>The code I created is specific to the website I was working on, but I&#8217;m pasting it here anyway in case it might be some help to someone.</p>
<p>function doClear( o ) {<br />
function setValue( o, myText ) {<br />
if ( o.value == myText ) {<br />
o.value = &#8221;;<br />
}<br />
else if ( o.value == &#8221; ) o.value = myText;<br />
}<br />
switch ( o.id ) {<br />
case &#8220;username&#8221;: {<br />
var myText = &#8216;Enter Username&#8217;;<br />
break;<br />
}<br />
case &#8220;password&#8221;: {<br />
var myText = &#8216;Enter Password&#8217;;<br />
o.type = &#8216;password&#8217;;<br />
break;<br />
}<br />
case &#8220;su_emailAddress&#8221;: {<br />
var myText = &#8216;Your Email Address&#8217;;<br />
break;<br />
}<br />
case &#8220;su_username&#8221;: {<br />
var myText = &#8216;Choose a Username&#8217;;<br />
break;<br />
}<br />
case &#8220;newsletterEmail&#8221;: {<br />
var myText = &#8216;Enter Email Address&#8217;;<br />
break;<br />
}<br />
case &#8220;su_password&#8221;: {<br />
var myText = &#8216;Choose Password&#8217;;<br />
o.type = &#8216;password&#8217;;<br />
break;<br />
}<br />
case &#8220;su_passwordConfirm&#8221;: {<br />
var myText = &#8216;Confirm Password&#8217;;<br />
o.type = &#8216;password&#8217;;<br />
break;<br />
}<br />
}<br />
setValue( o, myText );<br />
}</p>
<p>function displayPasswordValue( id ) {<br />
var passwordElement = document.getElementById( id );<br />
passwordElement.type = &#8220;text&#8221;;<br />
}<br />
function passwordInit() {<br />
displayPasswordValue( &#8216;password&#8217; );<br />
displayPasswordValue( &#8217;su_password&#8217; );<br />
displayPasswordValue( &#8217;su_passwordConfirm&#8217; );<br />
}<br />
YAHOO.util.Event.onDOMReady( passwordInit );</p>
Posted in JavaScript Tagged: JavaScript, password value, text <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/australiansearchengine.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/australiansearchengine.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/australiansearchengine.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/australiansearchengine.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/australiansearchengine.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/australiansearchengine.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/australiansearchengine.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/australiansearchengine.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/australiansearchengine.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/australiansearchengine.wordpress.com/289/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=australiansearchengine.wordpress.com&blog=2413165&post=289&subd=australiansearchengine&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://australiansearchengine.wordpress.com/2009/11/17/password-value-as-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33a716f695d0afe1d3ab565df0047391?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Taco Fleur</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert HTML entities from XML in JavaScript</title>
		<link>http://australiansearchengine.wordpress.com/2009/04/15/convert-html-entities-from-xml-in-javascript/</link>
		<comments>http://australiansearchengine.wordpress.com/2009/04/15/convert-html-entities-from-xml-in-javascript/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 23:29:39 +0000</pubDate>
		<dc:creator>Taco Fleur</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[decode]]></category>
		<category><![CDATA[entity]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://australiansearchengine.wordpress.com/?p=224</guid>
		<description><![CDATA[Sometimes you get passed a string from XML and it can contain HTML entities like the following
&#38;amp;
&#38;lt;
&#38;gt;
&#38;quot;
&#38;copy;
&#38;reg;
&#38;laquo;
&#38;raquo;
&#38;apos;
If you write the string with JavaScript then you get something like didn&#38;apos;t instead of didn&#8217;t
I&#8217;ve searched around for a function that could handle this but could not find one, so I wrote my own. I thought I&#8217;d share [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=australiansearchengine.wordpress.com&blog=2413165&post=224&subd=australiansearchengine&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometimes you get passed a string from XML and it can contain HTML entities like the following</p>
<p>&amp;amp;<br />
&amp;lt;<br />
&amp;gt;<br />
&amp;quot;<br />
&amp;copy;<br />
&amp;reg;<br />
&amp;laquo;<br />
&amp;raquo;<br />
&amp;apos;</p>
<p>If you write the string with JavaScript then you get something like <strong>didn&amp;apos;t</strong> instead of <strong>didn&#8217;t</strong></p>
<p>I&#8217;ve searched around for a function that could handle this but could not find one, so I wrote my own. I thought I&#8217;d share it with the world!</p>
<p>The following will convert &amp;amp; to &amp;, convert &amp;apos; to &#8216; etc.</p>
<p>Following is the code, if you need help implementing it, I&#8217;m more than happy to explain how you install and run this function in return for a text link on your website, now that&#8217;s cheap as, considering I normally charge $140 an hour <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<pre>String.prototype.trim = function () {
	return this.split( /\s/ ).join( " " );
}
String.prototype.convertHTMLEntity = function () {
	var myString = this;
	myString = myString.replace( /\&amp;amp;/g, '&amp;' );
	myString = myString.replace( /\&amp;lt;/g, '&lt;' );
	myString = myString.replace( /\&amp;quot;/g, '"' );
	myString = myString.replace( /\&amp;copy;/g, '©' );
	myString = myString.replace( /\&amp;reg;/g, '®' );
	myString = myString.replace( /\&amp;laquo;/g, '«' );
	myString = myString.replace( /\&amp;raqou;/g, '»' );
	myString = myString.replace( /\&amp;apos;/g, "'" );
	return myString;
}</pre>
Posted in JavaScript Tagged: convert, decode, entity, html, xml <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/australiansearchengine.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/australiansearchengine.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/australiansearchengine.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/australiansearchengine.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/australiansearchengine.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/australiansearchengine.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/australiansearchengine.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/australiansearchengine.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/australiansearchengine.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/australiansearchengine.wordpress.com/224/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=australiansearchengine.wordpress.com&blog=2413165&post=224&subd=australiansearchengine&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://australiansearchengine.wordpress.com/2009/04/15/convert-html-entities-from-xml-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33a716f695d0afe1d3ab565df0047391?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Taco Fleur</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert Microsoft Word Characters</title>
		<link>http://australiansearchengine.wordpress.com/2009/03/31/convert-microsoft-word-characters/</link>
		<comments>http://australiansearchengine.wordpress.com/2009/03/31/convert-microsoft-word-characters/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 05:18:15 +0000</pubDate>
		<dc:creator>Taco Fleur</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[convert word characters]]></category>

		<guid isPermaLink="false">http://australiansearchengine.wordpress.com/?p=217</guid>
		<description><![CDATA[I've written a JavaScript function a while ago that converts Microsoft Word Characters (crap) to valid HTML characters. Till today I didn't realize how valuable the function is, it could probably do with some expansion on what it converts so any help to improve is much appreciated.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=australiansearchengine.wordpress.com&blog=2413165&post=217&subd=australiansearchengine&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve written a JavaScript function a while ago that converts Microsoft Word Characters (crap) to valid HTML characters. Till today I didn&#8217;t realize how valuable the function is, it could probably do with some expansion on what it converts so any help to improve is much appreciated.</p>
<p>For those needing the function, just send me an email or leave a comment.</p>
<pre>/*
	‘ = 8216 convert to '
	’ = 8217 convert to '
	“ = 8220 convert to "
	” = 8221 convert to "

	bullet points from word: 61558, 8226, 61607
	convert them all to 111

	dash 8211 convert to -

	... 8230 convert to ...

	trademark symbol 8482 convert to TM

	copyright symbol 169 convert to (c)

	registered symbol 174 convert to (r)

	&gt;&gt; 187 convert to &gt;&gt;

	&lt;&lt; 171 convert to &lt;&lt;
<ul>
<li>/</li>
</ul>

function convertCharacter( obj ) {
	var myRegEx = new RegExp( String.fromCharCode( 8216 )
 + "|" + String.fromCharCode( 8217 ), "g" );
	obj.value = obj.value.replace( myRegEx, "'" );
	var myRegEx = new RegExp( String.fromCharCode( 8220 )
 + "|" + String.fromCharCode( 8221 ), "g" );
	obj.value = obj.value.replace( myRegEx, '"' );

	var myRegEx = new RegExp( String.fromCharCode( 61558 )
 + "|" + String.fromCharCode( 8226 ) + "|"
+ String.fromCharCode( 61607 ), "g" );
	obj.value =
obj.value.replace( myRegEx, String.fromCharCode( 111 ) );

	var myRegEx = new RegExp( String.fromCharCode( 8211 ), "g" );
	obj.value = obj.value.replace( myRegEx, "-" );

	var myRegEx = new RegExp( String.fromCharCode( 8230 ), "g" );
	obj.value = obj.value.replace( myRegEx, "..." );

	var myRegEx = new RegExp( String.fromCharCode( 8482 ), "g" );
	obj.value = obj.value.replace( myRegEx, "TM" );

	var myRegEx = new RegExp( String.fromCharCode( 169 ), "g" );
	obj.value = obj.value.replace( myRegEx, "(c)" );

	var myRegEx = new RegExp( String.fromCharCode( 174 ), "g" );
	obj.value = obj.value.replace( myRegEx, "(r)" );

	var myRegEx = new RegExp( String.fromCharCode( 187 ), "g" );
	obj.value = obj.value.replace( myRegEx, "&gt;&gt;" );

	var myRegEx = new RegExp( String.fromCharCode( 171 ), "g" );
	obj.value = obj.value.replace( myRegEx, "&lt;&lt;" );
}</pre>
Posted in JavaScript, Programming Tagged: convert word characters <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/australiansearchengine.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/australiansearchengine.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/australiansearchengine.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/australiansearchengine.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/australiansearchengine.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/australiansearchengine.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/australiansearchengine.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/australiansearchengine.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/australiansearchengine.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/australiansearchengine.wordpress.com/217/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=australiansearchengine.wordpress.com&blog=2413165&post=217&subd=australiansearchengine&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://australiansearchengine.wordpress.com/2009/03/31/convert-microsoft-word-characters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33a716f695d0afe1d3ab565df0047391?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Taco Fleur</media:title>
		</media:content>
	</item>
	</channel>
</rss>