<?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>Jorge Pedret &#187; javascript</title>
	<atom:link href="http://jorgepedret.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://jorgepedret.com</link>
	<description>Freelance Web Developer + Front End Designer</description>
	<lastBuildDate>Wed, 25 Jan 2012 16:43:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Accessing the URL hash and parameters using Javascript</title>
		<link>http://jorgepedret.com/web-development/accessing-the-url-hash-and-parameters-using-javascript/</link>
		<comments>http://jorgepedret.com/web-development/accessing-the-url-hash-and-parameters-using-javascript/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 21:27:24 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[parameter]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=526</guid>
		<description><![CDATA[You can access the URL of your page using simple Javascript by using the following code: document.location;]]></description>
			<content:encoded><![CDATA[<p>You can access the URL of your page using simple Javascript by using the following code:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script&gt;
my_url_object = document.location;
&lt;/script&gt;
</pre>
<p>That code yields out something like this in Chrome&#8217;s Javascript console:</p>
<p><a href="http://jorgepedret.com/wp-content/uploads/2011/06/Screen-shot-2011-06-20-at-2.10.39-PM.png"><img class="size-full wp-image-527 alignnone" title="document.location in Chrome's JS Console" src="http://jorgepedret.com/wp-content/uploads/2011/06/Screen-shot-2011-06-20-at-2.10.39-PM.png" alt="document.location in Chrome's JS Console" width="526" height="235" /></a></p>
<h2>Example of use:</h2>
<p>You can show certain section of your code depending on a hash tag in the URL:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;section-1&quot; class=&quot;section&quot;&gt;Section 1&lt;/div&gt;
&lt;div id=&quot;section-2&quot; class=&quot;section&quot;&gt;Section 2&lt;/div&gt;
&lt;script&gt;
$(function(){
	// Get the hash parameter from the URL.
	active_section = document.location.hash;
	// Hide ALL the sections
	$('.section').css('display','none');
	// Show the section specified in the URL
	// The URL can be:
	// - http://localhost/example/index.html#section-1 , or
	// - http://localhost/example/index.html#section-2
	$(active_section).css('display','block');
});
&lt;/script&gt;
</pre>
<p>Post a comment if you need help! <img src='http://jorgepedret.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/accessing-the-url-hash-and-parameters-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Notes for &#8220;Javascript &amp; WordPress&#8221;</title>
		<link>http://jorgepedret.com/web-development/my-notes-for-javascript-wordpress/</link>
		<comments>http://jorgepedret.com/web-development/my-notes-for-javascript-wordpress/#comments</comments>
		<pubDate>Thu, 05 May 2011 21:26:04 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[wcdev]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=368</guid>
		<description><![CDATA[Allen Pike packed JavaScript in a 20 minute talk, describing the similarities and differences with other programming languages. Javascript is the most widely deployed language ion the world. People are creating more apps in JavaScript than before because: Computers are faster All the raising JavaScript libraries that standardize and make JS a lot cooler JavaScript and [...]]]></description>
			<content:encoded><![CDATA[<p>Allen Pike packed JavaScript in a 20 minute talk, describing the similarities and differences with other programming languages.</p>
<div class="woo-sc-box normal   ">Download the presentation slides: <a href="http://www.antipode.ca/slides/tackling_js.pdf" class="woo-sc-button  custom medium" style="background:;border-color:"><span class="woo-download">Download</span></a></div>
<p>Javascript is the most widely deployed language ion the world. People are creating more apps in JavaScript than before because:</p>
<ul>
<li>Computers are faster</li>
<li>All the raising JavaScript libraries that standardize and make JS a lot cooler</li>
</ul>
<h3>JavaScript and PHP similarities</h3>
<ul>
<li>Dynamic and loose</li>
<li>C-like syntax</li>
<li>Curly braces</li>
<li>if, else, for, etc.</li>
<li>Garbage collection</li>
<li>Post-web</li>
</ul>
<h3>JavaScript and PHP differences</h3>
<ul>
<li>Everything is an object</li>
<li>Objects and inheritance</li>
<li>Scope and this</li>
</ul>
<h3>Lint</h3>
<ul>
<li>Bad parts are simple mistakes</li>
<li>JSLint, JavaScript Lint, JSHint</li>
<li>Auto lint</li>
</ul>
<h3>WordPress</h3>
<h3><span style="font-size: 13px; font-weight: normal;">The function wp_enque script helps you load common libraries like </span><span style="font-size: 13px; font-weight: normal;">jQuery, Scriptaculous, jQUI, TinyMCE, and it lets let load your own js files. You can also specify if you want your files to load in the footer to optimize loading speed <img src='http://jorgepedret.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Thanks <a href="http://twitter.com/apike">@apike</a> for answering my question.</span></h3>
<h3>JavaScript Libaries</h3>
<ul>
<li>DOM (jQuery, Prototype) — Most popular libraries for manipulating the DOM</li>
<li>MVC (Backbone, JSMBC, Spine) — Libraries that helps you write JavaScript in a more organized and MVC way</li>
<li>Everything (ExtJS, YUI, SproutCore)  — They do everything</li>
<li>microjs.com — Recently launched library where you can chose what you want</li>
</ul>
<h3>Debugging JavaScript</h3>
<ul>
<li>console.log(), and console.trace()</li>
<li>stack traces, step debugging</li>
</ul>
<h3>Other resources for learning JavaScript</h3>
<ul>
<li>Learning Advanced JavaScript — <a href="http://ejohn.org/apps/learn/">http://ejohn.org/apps/learn/</a></li>
<li>Douglas Crockford — <a href="http://javascript.crockford.com/">javascript.crockford.com</a></li>
<li>VanJS: — <a href="http://www.meetup.com/vancouver-javascript-developers/">vanjs.com</a></li>
</ul>
<h2>Get in touch with Allen Pike</h2>
<p><a href="http://www.antipode.ca">www.antipode.ca</a><br />
<a href="http://www.steamclocksw.com">www.steamclocksw.com</a><br />
<a href="http://twitter.com/apike">@apike</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/my-notes-for-javascript-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS won&#8217;t style my HTML5 markup in Internet Explorer!</title>
		<link>http://jorgepedret.com/web-development/html5-web-development/css-wont-style-my-html5-markup-in-internet-explorer/</link>
		<comments>http://jorgepedret.com/web-development/html5-web-development/css-wont-style-my-html5-markup-in-internet-explorer/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 02:34:44 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[new html5 tags]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=169</guid>
		<description><![CDATA[You built your whole website using html5 new shiny tags, you're so proud of yourself, it looks great in your development browser. Time to give it a test in Internet Explorer to see what it looks like. It looks a lot worst than you was expecting... What the heck is going on?

Make html5 work under ie6, ie7 &#038; ie8 by adding this small JavaScript code.]]></description>
			<content:encoded><![CDATA[<p>You built your whole website using html5 new shiny tags, you&#8217;re so proud of yourself, it looks great in your development browser!!</p>
<p>It&#8217;s finally time to give it a test in Internet Explorer, let&#8217;s see how it looks like&#8230;</p>
<p>WHAT??? That looks a lot worst than I was expecting&#8230; What the heck is going on?</p>
<p>You try changing your css, but explorer doesn&#8217;t change at all&#8230; You verify if you&#8217;re actually working on the right file, and yes in deed, you are. You try to add some basic css properties, but again, it doesn&#8217;t change a bit. The problem is&#8230;</p>
<h3>Internet Explorer completely ignores html5 new tags</h3>
<p>OMG! Until when this stupid browser is going to give me head aches &#8211; you say out loud.</p>
<p>At this point you have two options:</p>
<ol>
<li>Change your entire markup and css to use old tags</li>
<li>Use Remy Sharp&#8217;s fix. The only downsize: It completely depends on Javascript</li>
</ol>
<p>IE simply ignores all the elements it doesn&#8217;t recognize, regardless of CSS. By using javascript&#8217;s function document.createElement(), we iterate through the markup and recreate all the tags that are not recognized by IE.</p>
<h3>Quick copy/paste solution</h3>
<p>Here is the code taken directly from <a href="http://remysharp.com/2009/01/07/html5-enabling-script/">Remy&#8217;s site</a>:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;!--[if IE]&gt;
&lt;script src=&quot;http://html5shim.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;
</pre>
<p>I&#8217;m thinking it might be a good idea to condition the code to IE versions lower than 8, since IE9 will have html5 support and it might be coming soon, but that&#8217;s up to you:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;!--[if lte IE 8]&gt;
&lt;script src=&quot;http://html5shim.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;
</pre>
<p>I feel stupid for not being aware and for not testing earlier in IE. It took me a while to figure out what was going on.</p>
<p>Get more information from this sites:<br />
<a href="http://net.tutsplus.com/tutorials/html-css-techniques/how-to-make-all-browsers-render-html5-mark-up-correctly-even-ie6/">http://net.tutsplus.com/tutorials/html-css-techniques/how-to-make-all-browsers-render-html5-mark-up-correctly-even-ie6/</a><br />
<a href="http://remysharp.com/2009/01/07/html5-enabling-script/">http://remysharp.com/2009/01/07/html5-enabling-script/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/html5-web-development/css-wont-style-my-html5-markup-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Code Highlight</title>
		<link>http://jorgepedret.com/web-development/wordpress-code-highlight/</link>
		<comments>http://jorgepedret.com/web-development/wordpress-code-highlight/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 04:22:28 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[highlight]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.jorgepedret.com/blog/?p=19</guid>
		<description><![CDATA[While I was writing the last post, I was trying to find a nice code highlighter with this requirements: Keep Indentation: I want to code to look nice, but if it&#8217;s not indented correctly as I submit it, then it&#8217;s garbage Support Different Languages: I&#8217;m going to be writing post about Javascript, PHP, XHTML and [...]]]></description>
			<content:encoded><![CDATA[<p>While I was writing the last post, I was trying to find a nice code highlighter with this requirements:</p>
<ol>
<li><strong>Keep Indentation:</strong> I want to code to look nice, but if it&#8217;s not indented correctly as I submit it, then it&#8217;s garbage</li>
<li><strong>Support Different Languages</strong>: I&#8217;m going to be writing post about Javascript, PHP, XHTML and I need all these languages/markups to be highlighted</li>
<li><strong>Line number/Plain code view:</strong> You should be able to switch between plain code view and line number. I couldn&#8217;t find specifically what I was looking for but this one had a different approach to solve this problem.</li>
<li><strong>W3C Compliant:</strong> The code produced has to be W3C Compliant.</li>
</ol>
<p>After like 1 hour of research and testing, I found <strong>SyntaxHighlighter Evolved! </strong>here is the plugin&#8217;s website: <a href="http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/" target="_blank">http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/</a>.</p>
<p>To install it you can go to your WordPress Admin panel and look for SyntaxHighlighter Evolved and install it.</p>
<p>To use it:[language]&#8230;code&#8230;[/language]<br />
Example:</p>
<pre class="brush: plain; title: ; notranslate">
1
</pre>
<p>It&#8217;s pretty straight forward, for better details on how to use it, I went to my WordPress Admin Back-end &gt; Plugins &gt; Installed, then I looked for SyntaxHighlighter Evolved and clicked on Settings, at the bottom of this page you&#8217;ll see the details of what parameters you can pass to change the functionality.</p>
<p>Do you know another code highlighter that works better than this one?</p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/wordpress-code-highlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

