<?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>ramblings &#187; javascript</title>
	<atom:link href="http://techore.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://techore.com</link>
	<description>come to your own conclusions</description>
	<lastBuildDate>Mon, 30 Aug 2010 15:08:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WordPress theme hacked?</title>
		<link>http://techore.com/2010/02/wordpress-theme-hacked/</link>
		<comments>http://techore.com/2010/02/wordpress-theme-hacked/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 16:47:03 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jorge gomez]]></category>
		<category><![CDATA[swithroyale.com]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress theme]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp theme]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=254</guid>
		<description><![CDATA[I've been using a theme created by Jorge Gomez at switchroyale.com and have been very happy with it.  I logged on today to get a bit of info from one of my earlier posts and noticed that after ~5 seconds my site was redirecting to a seemingly random website.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using a WordPress theme created by Jorge Gomez at <a title="switchroyale.com" href="http://switchroyale.com" target="_blank">switchroyale.com</a> and have been very happy with it.  I logged on today to get a bit of info from one of my earlier posts and noticed that after ~5 seconds after the page loaded my site was redirecting to a seemingly random website.</p>
<p>I started some debugging and first deactivated my AdSense plugin thinking that was the culprit.  It turns out that the theme was loading some javascript from an external site and was executing the redirect.</p>
<p>I was using Azul 1.4 and noticed there was an upgrade available and I updated my site to Azul 1.51.  This did not solve my problem.  I&#8217;ve reverted back to an old WordPress default theme and the problem went away.  I&#8217;ve sent an email to Mr. Gomez to let him know about the issue.  I hope that it&#8217;s either a simple error or that his site was hacked (I&#8217;m not being mean).  I&#8217;d much rather believe that his site got hacked than if he decided to start screwing with people themes out of malicious intent.</p>
<p>I&#8217;m happy to give him the benefit of the doubt until I learn otherwise.  I&#8217;ve included the email that I sent him below:</p>
<blockquote><p>Hey I just wanted to let you know that I&#8217;ve been using your theme for awhile and have enjoyed it, but today I noticed that there is some javascript coming through on your theme that is causing my site to redirect to a seemingly random website after the site is loaded for ~5 seconds.</p>
<p>I had been using Azul 1.4, but after noticing this issue I upgraded to Azul 1.51 and am still getting this issue.  I&#8217;ve reverted back to an old default WP theme and the issue went away and when I reactivated your theme the issue came back.</p>
<p>I don&#8217;t know if you are aware of this issue or whether your site might have gotten hacked.</p>
<p>Just wanted to let you know.</p>
<p>Hope this gets resolved.</p></blockquote>
<p>I&#8217;ll update this post as needed.</p>
<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2010/02/wordpress-theme-hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding javascript to symfony form field</title>
		<link>http://techore.com/2009/11/adding-javascript-to-symfony-form-field/</link>
		<comments>http://techore.com/2009/11/adding-javascript-to-symfony-form-field/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 21:27:25 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[onchange]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sfWidget]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=194</guid>
		<description><![CDATA[In the users table at my company's website there are fields for company, division, region, and location.  Since each level of the company organization affects all the lower categories I have to filter out the invalid choices when a higher level choice is selected.]]></description>
			<content:encoded><![CDATA[<p>In the users table at my company&#8217;s website there are fields for company, division, region, and location.  Since each level of the company organization affects all the lower categories I have to filter out the invalid choices when a higher level choice is selected.</p>
<p>I&#8217;ve implemented this on some forms that I&#8217;ve created manually on the site but not in any forms that I haven&#8217;t heavily modified from the stock symfony creation.  I started googling around to find a solution but could not find a simple explanation of how to do it.  I expected to find at least some information in one of symfony&#8217;s otherwise excellent tutorials, but alas, no.</p>
<p>I had a minor epiphany and went digging through the forms API that symfony provides and realized that I should easily be able to do this through the sfWidgetFormPropelChoice method.  The second parameter passed is the html attributes for the form field.  I thought I had seen a form post <a title="symfony forum" href="http://bit.ly/3f9j24" target="_blank">here</a> that said that I could add javascript code to the html attributes and not have it get converted into html entities.</p>
<p>I tried throwing a simple alert() inside the onchange attribute for my company box and wham! it worked!  So simple.  Code below:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormPropelChoice<span style="color: #009900;">&#40;</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'model'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Company'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'add_empty'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'onchange'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;filterBy('company', 'division', this.value, 'sf_guard_user_user_division_id');&quot;</span> <span style="color: #339933;">.</span>
			<span style="color: #0000ff;">&quot;filterBy('company', 'region', this.value, 'sf_guard_user_user_region_id');&quot;</span> <span style="color: #339933;">.</span>
			<span style="color: #0000ff;">&quot;filterBy('company', 'location', this.value, 'sf_guard_user_user_location_id');&quot;</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2009/11/adding-javascript-to-symfony-form-field/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IE 7 javascript bug</title>
		<link>http://techore.com/2009/11/ie-7-javascript-bug/</link>
		<comments>http://techore.com/2009/11/ie-7-javascript-bug/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 17:18:19 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Developer Tools]]></category>
		<category><![CDATA[experts-exchange]]></category>
		<category><![CDATA[experts-exchange.com]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[select options filtering]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=191</guid>
		<description><![CDATA[In a form that I administer at work I have a javascript filtering function for a few select boxes.  It is called whenever the first select box changes and removes the ineligible options from the second select box.  Simple.  Straight-forward.

It doesn't work in IE 7, works fine in IE 8, Firefox, Chrome.  But we have many clients that are stuck in IE 7 or even IE 6.  I sat down to figure this out and realized that my IE debugging tools aren't nearing as good as my Firefox debugging.  In Firefox I use Firebug, but in IE I use the built in Developer Tools (DT).]]></description>
			<content:encoded><![CDATA[<p>In a form that I administer at work I have a javascript filtering function for a few select boxes.  It is called whenever the first select box changes and removes the ineligible options from the second select box.  Simple.  Straight-forward.</p>
<p>It doesn&#8217;t work in IE 7, works fine in IE 8, Firefox, Chrome.  But we have many clients that are stuck in IE 7 or even IE 6.  I sat down to figure this out and realized that my IE debugging tools aren&#8217;t nearing as good as my Firefox debugging.  In Firefox I use Firebug, but in IE I use the built in Developer Tools (DT).</p>
<p>The one big difference between these two plug-ins for this particular problem is that DT doesn&#8217;t live update the code of the page when it is changed with javascript.  You must manually refresh the code inside of DT.  Once I discovered this I was much more productive.</p>
<p>But onto the problem.  I discovered that when I was creating the &#8216;filtered&#8217; select box, I was actually just wiping the original box out and creating a new one from scratch.  In this new select box all the attributes were correct except for the name.  Instead of the attribute being called &#8216;name&#8217; it was being called &#8216;submitName&#8217;.</p>
<p>I googled that and the only relevant thing that I could get was an experts-exchange link that I refuse to use.  I have a problem with a website charging people for solutions to simple code problems.  Whenever I get google results for that site I remove it from my results.</p>
<p>I ended up reworking my code to actually filter out the unwanted options when the first select box is changed.  But in case someone else has had the problem that I&#8217;m having and knows the solution, I will post the code that I was using to create the select box.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> createSelect<span style="color: #009900;">&#40;</span>parent_cell<span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> id<span style="color: #339933;">,</span> options<span style="color: #339933;">,</span> option_values<span style="color: #339933;">,</span> classs<span style="color: #339933;">,</span> onchange<span style="color: #339933;">,</span> removeChildren<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// classs is misspelled cause otherwise IE thinks it is a Class</span>
	<span style="color: #000066; font-weight: bold;">try</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> par_cell <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>parent_cell<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> sel_box <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'onchange'</span><span style="color: #339933;">,</span> onchange<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #339933;">,</span> classs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> first_opt <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'option'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		first_opt.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
		first_opt.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Select an Option'</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">options</span>.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>first_opt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>options.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> opt <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'option'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			opt.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> option_values<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			opt.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> options<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			sel_box.<span style="color: #660066;">options</span>.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>opt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>removeChildren<span style="color: #009900;">&#41;</span>
			removeAllChildren<span style="color: #009900;">&#40;</span>parent_cell<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		par_cell.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>sel_box<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;There was an error creating the options menu: &quot;</span> <span style="color: #339933;">+</span> err<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2009/11/ie-7-javascript-bug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>soooo, this is like an all new blog</title>
		<link>http://techore.com/2009/02/soooo-this-is-like-an-all-new-blog/</link>
		<comments>http://techore.com/2009/02/soooo-this-is-like-an-all-new-blog/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 04:50:05 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[dell mini 9]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mini 9]]></category>
		<category><![CDATA[palm pre]]></category>
		<category><![CDATA[pre]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=91</guid>
		<description><![CDATA[Recently have split with my girlfriend of a few months.  Started my third job out of college in the span of 14 months.  Have started doing some web projects for other people, a little money on the side never hurt.  Am getting stoked about the new Palm Pre.  Am living in Decatur, GA, in a 3/1.5 house by myself, waiting for my fantastic sister-in-law to find someone to rent the house so I can move out.]]></description>
			<content:encoded><![CDATA[<p>so it&#8217;s been years, literally, not just in a tech sense, since the last time I wrote a blog post.  I have been meaning to start this back up for a little while now that I have a real job and am out of school.  But you know how things always seem to get in the way.  I finally found a nice, new, clean domain name&#8230;.heehee.  I love my new domain. <img src='http://techore.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p> </p>
<p>So, life.</p>
<p> </p>
<p>Recently have split with my girlfriend of a few months.  Started my third job out of college in the span of 14 months.  Have started doing some web projects for other people, a little money on the side never hurt.  Am getting stoked about the new <a href="http://www.palm.com/us/products/phones/pre/" target="_blank">Palm Pre</a>.  Am living in Decatur, GA, in a 3/1.5 house by myself, waiting for my fantastic sister-in-law to find someone to rent the house so I can move out.  </p>
<p>Current loves:</p>
<p>my car:  2006 VW Golf GLS</p>
<p>my job: web developer </p>
<p>hometown: atlanta</p>
<p> </p>
<p>Current non-loves:</p>
<p>my living situation: no cool roommate(s)</p>
<p>computing power:  need a new desktop bbbaaaadddd</p>
<p>friends:  they live too far away</p>
<p> </p>
<p>So today I bought my first new computer in ~4 years.  A Dell Mini 9.  I saw on <a href="http://engadget.com" target="_blank">engadget</a> that Dell was having a $199 sale on them and that hit my impulse buy price.  I added a integrated webcam and messenger bag for it and off my order went.  It sucks that the estimated ship date is St. Paddy&#8217;s day, but oh well, at least I got a great deal on my lappie.  In a few months I plan on completely overhauling my desktop computer.  It&#8217;s currently running something like single core 2.4 GHz, 512MB RAM, 32MB Video Card, all from ~4 years ago.  I plan upping the specs to Core i7 920 (2.66GHz quad core), 4-6GB RAM, 512MB Video card.  This should definitely improve my computing experience at home.  I&#8217;m also planning on installing the windows 7 beta.  I had installed it on my workhorse laptop, but with it being 4 years old, I don&#8217;t think 7 really agreed with it cause it started crashing more than it was running.  But anyway, onwards and upwards!</p>
<p> </p>
<p>I am really looking forward to the new Palm Pre.  Before it was announced, I felt that Palm was starting it&#8217;s death rattle.  They hadn&#8217;t put anything exciting out in a few years and was having internal struggles which is indicative of a dying company.  But Palm surprised the entire tech community at CES 2009 when they introduced the Pre and webOS.  No one saw this coming, there weren&#8217;t any leaks or buzz surrounding Palm before their keynote.  After the keynote, Palm was all anybody could talk about.  As soon as I heard that there was going to be a <a href="http://atlanta.predevcamp.org/" target="_blank">development camp in Atlanta</a>, I signed up for it and voluteered.  I figured it was time to get into the tech community in Atlanta and hopefully meet some new people down here.  There is not a date set for preDevCamp yet, but I&#8217;m hearing that it will be about a week after the Pre actually launches.</p>
<p> </p>
<p>Last night I watched the hour long webcast that Palm&#8217;s Software CTO Mitch Allen put on.  He only provided general information about the Pre and webOS, but it was encouraging to see how simple it will be to create an app on the Pre.  I need to start brushing up/learning javascript now.  :-)</p>
<p> </p>
<p>So I&#8217;m about out of info for this first post in a while.  Be back more often from now on.</p>
<p> </p>
<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2009/02/soooo-this-is-like-an-all-new-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
