<?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>dev.enekoalonso.com &#187; console</title>
	<atom:link href="http://dev.enekoalonso.com/tag/console/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.enekoalonso.com</link>
	<description>having fun with code</description>
	<lastBuildDate>Wed, 12 Oct 2011 21:40:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Javascript console in the terminal (command line)</title>
		<link>http://dev.enekoalonso.com/2010/10/05/javascript-console-in-the-terminal-command-line/</link>
		<comments>http://dev.enekoalonso.com/2010/10/05/javascript-console-in-the-terminal-command-line/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 04:15:19 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[exe]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=672</guid>
		<description><![CDATA[I&#8217;ve been looking for a command line Javascript console for a while. I have even thought of creating my own one, some hybrid between my fake Linux terminal and JSFiddle.net. Lately, I&#8217;ve been working with node.js lately on a little project just for fun. Never before I had done server side Javascript and it looks [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for a command line Javascript console for a while. I have even thought of creating my own one, some hybrid between <a href="http://enekoalonso.com">my fake Linux terminal</a> and <a href="http://www.jsfiddle.net">JSFiddle.net</a>. Lately, I&#8217;ve been working with <a href="http://dev.enekoalonso.com/tag/node-js/">node.js</a> lately on a little project just for fun. Never before I had done server side Javascript and it looks like it has serious potential. But still, I had no console other than Firebug or, my favorite, the one included in Webkit.</p>
<p>So I am very happy after coming across this article which shows <a href="http://webreflection.blogspot.com/2010/10/javascriptcore-via-terminal.html">how to use the JavaScriptCore.Framework included in Mac OS X on the command line</a>. Doing some Google searches, looks like people have been talking about this <a href="http://www.phpied.com/javascript-shell-scripting/">for a long time</a>. Even more! Here is <a href="http://www.phpied.com/make-your-javascript-a-windows-exe/">how to compile javascript to .exe in Windows</a>. Didn&#8217;t even thought that could be possible, being Javascript such a dynamic language.</p>
<p>One interesting thing about the jsc Javascript console is that you can load() javascript files from disk. Thus, one can get the <a href="http://mootools.net/core">Mootools core</a> (Core + Function + Array + Number + String + Hash + Class + Class.Extras + JSON) and load it to start creating awesome classes, etc.</p>
<p>This is going to be a lot of fun :)</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>October 12, 2011 -- <a href="http://dev.enekoalonso.com/2011/10/12/command-line-scripting-with-node-js/" title="Command line scripting with Node.js">Command line scripting with Node.js</a> (0)</li><li>July 13, 2011 -- <a href="http://dev.enekoalonso.com/2011/07/13/clone-your-osxterminal-window/" title="Clone your OSX terminal window">Clone your OSX terminal window</a> (1)</li><li>September 17, 2010 -- <a href="http://dev.enekoalonso.com/2010/09/17/mootools-core-for-server-and-mobile-development/" title="MooTools Core for Server and Mobile Development">MooTools Core for Server and Mobile Development</a> (1)</li><li>July 30, 2010 -- <a href="http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/" title="Titanium Developer: love and hate">Titanium Developer: love and hate</a> (3)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/10/05/javascript-console-in-the-terminal-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Highlighting elements with Firebug console</title>
		<link>http://dev.enekoalonso.com/2008/12/02/highlighting-elements-with-firebug-console/</link>
		<comments>http://dev.enekoalonso.com/2008/12/02/highlighting-elements-with-firebug-console/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 19:24:27 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[prototypejs]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=74</guid>
		<description><![CDATA[Today I had an issue with an element was breaking a page layout, making the page width wider than 960px. I tried to find it with Firebug, looking at the layout properties of some divs and elements, but I couldn&#8217;t find it. I knew it had to be there, so I decided to highlight all [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had an issue with an element was breaking a page layout, making the page width wider than 960px. I tried to find it with Firebug, looking at the layout properties of some divs and elements, but I couldn&#8217;t find it. I knew it had to be there, so I decided to highlight all div elements in the page with a red border. And it worked! I found it right away.</p>
<p>Here is the code I used to highlight the fields (I had to do it in prototype only):</p>
<p>Prototype JS:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1"><span class="sy0">&lt;</span>img src=<span class="st0">&quot;http://l.wordpress.com/latex.php?latex=%28%27div%27%29.each%28function%28item%29%7B%20%20%24%28item%29.setStyle%28%7B%20border%3A%20%27solid%201px%20red%27%20%7D%29%3B%7D%29%3B%3C%2Fpre%3EjQuery%3A%3Cpre%20lang%3D%22javascript%22%3E%24%28%27div%27%29.css%28%27border%27%2C%20%27solid%201px%20red%27%29%3B%3C%2Fpre%3EMootools%3A%3Cpre%20lang%3D%22javascript%22%3E&amp;bg=0D324F&amp;fg=FFFFFF&amp;s=1&quot;</span> title=<span class="st0">&quot;(&#39;div&#39;).each(function(item){ &nbsp;$(item).setStyle({ border: &#39;solid 1px red&#39; });});</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0"</span></div>
</li>
</ol>
</div>
<p>jQuery:
<pre lang="javascript">$('div').css('border', 'solid 1px red');</pre>
<p>Mootools:
<pre lang="javascript">" style="vertical-align:-20%;" class="tex" alt="('div').each(function(item){  $(item).setStyle({ border: 'solid 1px red' });});</pre>
<p>jQuery:
<pre lang="javascript">$('div').css('border', 'solid 1px red');</pre>
<p>Mootools:
<pre lang="javascript">" />('div').setStyle('border', 'solid 1px red');
</pre>
<p>PS: Note that by adding a 1px border to all divs in the page, the page layout will be affected and some items may display improperly. Of course, you can use other colors than red :)</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>November 30, 2008 -- <a href="http://dev.enekoalonso.com/2008/11/30/injecting-javascript-with-firebug/" title="Injecting javascript with Firebug">Injecting javascript with Firebug</a> (0)</li><li>October 5, 2010 -- <a href="http://dev.enekoalonso.com/2010/10/05/javascript-console-in-the-terminal-command-line/" title="Javascript console in the terminal (command line)">Javascript console in the terminal (command line)</a> (1)</li><li>September 2, 2009 -- <a href="http://dev.enekoalonso.com/2009/09/02/creating-html-blocks-with-mootools/" title="Creating HTML blocks with Mootools">Creating HTML blocks with Mootools</a> (4)</li><li>November 29, 2008 -- <a href="http://dev.enekoalonso.com/2008/11/29/jsclass-a-very-nice-object-oriented-approach/" title="JS.Class: a very nice object oriented approach">JS.Class: a very nice object oriented approach</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2008/12/02/highlighting-elements-with-firebug-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Injecting javascript with Firebug</title>
		<link>http://dev.enekoalonso.com/2008/11/30/injecting-javascript-with-firebug/</link>
		<comments>http://dev.enekoalonso.com/2008/11/30/injecting-javascript-with-firebug/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 05:29:22 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[injection]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=64</guid>
		<description><![CDATA[Sometimes you may want to include a Javascript file on a live web page to see how things will work or to try new things. Usually you would do this by editing the source code including the new file but there is a fastest way if you have Firefox with Firebug. Just run the following [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you may want to include a Javascript file on a live web page to see how things will work or to try new things. Usually you would do this by editing the source code including the new file but there is a fastest way if you have Firefox with Firebug. Just run the following code in the Javascript console:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> headID = document.<span class="me1">getElementsByTagName</span><span class="br0">&#40;</span><span class="st0">&quot;head&quot;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> newScript = document.<span class="me1">createElement</span><span class="br0">&#40;</span><span class="st0">&#39;script&#39;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">newScript.<span class="me1">type</span> = <span class="st0">&#39;text/javascript&#39;</span>;</div>
</li>
<li class="li1">
<div class="de1">newScript.<span class="me1">src</span> = <span class="st0">&#39;http://enekoalonso.com/lib/jquery-1.2.6.min.js&#39;</span>;</div>
</li>
<li class="li1">
<div class="de1">headID.<span class="me1">appendChild</span><span class="br0">&#40;</span>newScript<span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>Here I am loading the jQuery library from my own server, but I could load any Javascript from any server on the net. The best is this will work on any website, whenever you have access to the server or not. Once you have the Javascript loaded you can use it right away. For example, here on this blog I could use jQuery to check how the header will look if its height was only 100px by running the next command on the console:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1">jQuery<span class="br0">&#40;</span><span class="st0">&#39;#header&#39;</span><span class="br0">&#41;</span>.<span class="me1">css</span><span class="br0">&#40;</span><span class="st0">&#39;height&#39;</span>,<span class="nu0">100</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>Yep, it won&#8217;t look very good, right? Try it! You have to see it by yourself. Firefox is great. Firebug is awesome. And Firebug&#8217;s Javascript console is the best thing ever!<br />
PS: In case you are wondering, the Javascript file injected will exist only on the current browser session.</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>December 2, 2008 -- <a href="http://dev.enekoalonso.com/2008/12/02/highlighting-elements-with-firebug-console/" title="Highlighting elements with Firebug console">Highlighting elements with Firebug console</a> (0)</li><li>January 20, 2010 -- <a href="http://dev.enekoalonso.com/2010/01/20/debugging-cookies-with-firebug-1-51-6/" title="Debugging cookies with Firebug 1.5/1.6">Debugging cookies with Firebug 1.5/1.6</a> (1)</li><li>January 19, 2010 -- <a href="http://dev.enekoalonso.com/2010/01/19/firefox-3-6rc2-firebug-1-6a/" title="Firefox 3.6RC2 &#038; Firebug 1.6a">Firefox 3.6RC2 &#038; Firebug 1.6a</a> (0)</li><li>October 5, 2010 -- <a href="http://dev.enekoalonso.com/2010/10/05/javascript-console-in-the-terminal-command-line/" title="Javascript console in the terminal (command line)">Javascript console in the terminal (command line)</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2008/11/30/injecting-javascript-with-firebug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

