<?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>gHacks technology news &#187; ajax</title>
	<atom:link href="http://www.ghacks.net/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Wed, 25 Nov 2009 09:43:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using javascript to hide and unhide elements dynamically</title>
		<link>http://www.ghacks.net/2009/01/15/using-javascript-to-hide-and-unhide-elements-dynamically/</link>
		<comments>http://www.ghacks.net/2009/01/15/using-javascript-to-hide-and-unhide-elements-dynamically/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 01:29:15 +0000</pubDate>
		<dc:creator>Daniel Pataki</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=9899</guid>
		<description><![CDATA[My favorite aspect of javascript is that it enables you to add great features to your site like showing/hiding parts of it when a user clicks a link without reloading, get some data from a database and displaying it in a new div, again without reloading. In fact, it would be possible (although not very [...]]]></description>
			<content:encoded><![CDATA[<p>My favorite aspect of javascript is that it enables you to add great features to your site like showing/hiding parts of it when a user clicks a link without reloading, get some data from a database and displaying it in a new div, again without reloading. In fact, it would be possible (although not very comfortable and easily codeable) to create a big website, like a Wordpress blog without any reloading at all, no matter where you click.</p>
<p>This is usually referred to as AJAX, although most of it is javascript and HTML, and it is actually easier than it seems. In my opinion calling the hiding and showing of elements is not yet AJAX, because in my eyes ture AJAX communicates with the server in the background. We will only be changing CSS properties and element contents with javascript in this post to achieve our goal.</p>
<p>Let&#8217;s say you&#8217;re creating a form, and you want a way to explain what the fields do or what data they need to contain, but you don&#8217;t want to fill up too much space on screen, and you want to make it as unobtrusive as possible. In this case it would be cool to have a link with the anchortext &#8220;Explain&#8221;, which would expand a section which explains what the user needs to do.</p>
<p><span id="more-9899"></span></p>
<p>As the first step, we need to create a div which will hold the explanation text, and a link which will unhide it for the user.<br />
<code><br />
&lt;a id="link1" href="javascript:display('show', 1)"&gt;Explain&lt;/a&gt;<br />
&lt;div id="explanation1" style="display:none"&gt;This form let's you input your order details, please keep it short!&lt;/div&gt;<br />
</code></p>
<p>As you can see I have given the div a unique identifier. This is needed so the javascript knows which div I want to change. I have added a number to the id because there might be many more explanations, these would receive different numbers. I have also given the link an id, with the same number at the end as the div. Once the user clicked the link, we want to change the link, so clicking it again will close the div. </p>
<p>The link contains &#8220;javascript:&#8221;, which indicates that this link doesn&#8217;t point to a page, but should execute javascript code, in our case a function (display), with two arguments. The first tells the javascript function which will execute that we want to show the div (as opposed to hiding it), the second is a numerical identifier, which should be the same as the number in the div&#8217;s id. Take a look at the javascript code below with the explanation afterwards. </p>
<p><code><br />
&lt;script type="text/javascript"&gt;<br />
<br />
function display(action, id)<br />
{<br />
	if (action == 'show')<br />
	{<br />
	document.getElementById("explanation"+id).style.display = "block";<br />
	document.getElementById("link"+id).href= "javascript:display('hide', "+id+")";<br />
	document.getElementById("link"+id).innerHTML = "Close";<br />
	}<br />
<br />
	if (action == 'hide')<br />
	{<br />
	document.getElementById("explanation"+id).style.display = "none";<br />
	document.getElementById("link"+id).href= "javascript:display('show', "+id+")";<br />
	document.getElementById("link"+id).innerHTML = "Explain";<br />
	}<br />
}<br />
<br />
&lt;/script&gt;<br />
</code></p>
<p>As you can see, the two arguments are named &#8220;action&#8221; and &#8220;id&#8221;. The action argument will tell the script what we want to do (close the div or show it), the id argument will tell it which element we want to do it with. When you first click on the link the action is &#8220;show&#8221;, so let&#8217;s take a look at what&#8217;s happening there.</p>
<p>First of all, the script checks what the action is. It sees that it is &#8220;show&#8221;, so it executes three lines. the first line sets the div&#8217;s dispaly to block, which means that it will appear, you will be able to read the text. this is achieved by &#8220;grabbing&#8221; the element using its unique id. By specifying &#8220;document.getElementById(&#8217;theidhere&#8217;)&#8221; you can grab any element. In our case, we always grab the element &#8220;explanationX&#8221;, where X is the number beside it, given by the id argument. This id argument makes it possible to use one function for all the divs you want to open or close, so we won&#8217;t need to code the same function for all the different ids out there. The bit of code following specifies that we want to change the style, more specifically the display property, and we want to change it to &#8220;block&#8221;. </p>
<p>The second line grabs the link element, and instead of changing the style, it changes the address it points to (href), which in our case will be a new piece of javascript code. We change it to the exact same code, but instead of &#8220;show&#8221; as the action, we now have hide. </p>
<p>Line 3 grabs the same link element, but now changes the element contents. An element&#8217;s contents is always whatever is between the start and end tag, in a link&#8217;s case this is the anchor text. We change it from &#8220;Explain&#8221; to &#8220;Close&#8221; so the user knows that the div will disappear if he clicks the link again. </p>
<p>The three lines in case the action is &#8220;hide&#8221; do the exact same things, but change the values back, so if the user wants to open the div again he can do so. </p>
<p>That wasn&#8217;t so hard was it? The uses for these javascript methods are truly endless, from checking registration forms before submitting, to dynamically adding text to your site, you can do almost anything here, your imagination is truly the limit, so have fun!</p>

	Tags: <a href="http://www.ghacks.net/tag/ajax/" title="ajax" rel="tag">ajax</a>, <a href="http://www.ghacks.net/tag/css/" title="css" rel="tag">css</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/02/01/web-development-php-what-role-does-it-fill/" title="Web Development: PHP &#8211; what role does it fill (February 1, 2009)">Web Development: PHP &#8211; what role does it fill</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/08/19/view-javascript-sources-with-jsview/" title="View Javascript Sources with JSView (August 19, 2008)">View Javascript Sources with JSView</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/11/07/remove-adverts-on-wikipedia/" title="Remove adverts on Wikipedia (November 7, 2008)">Remove adverts on Wikipedia</a> (4)</li>
	<li><a href="http://www.ghacks.net/2007/09/30/preezo-create-powerpoint-presentations-online/" title="Preezo: Create Powerpoint Presentations Online (September 30, 2007)">Preezo: Create Powerpoint Presentations Online</a> (12)</li>
	<li><a href="http://www.ghacks.net/2009/02/16/php-what-it-does-and-what-it-doesnt/" title="PHP &#8211; what it does and what it doesn&#8217;t (February 16, 2009)">PHP &#8211; what it does and what it doesn&#8217;t</a> (4)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/01/15/using-javascript-to-hide-and-unhide-elements-dynamically/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Google Code University</title>
		<link>http://www.ghacks.net/2008/03/19/google-code-university/</link>
		<comments>http://www.ghacks.net/2008/03/19/google-code-university/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 13:47:30 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Knowledge]]></category>
		<category><![CDATA[Online Services]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[distributed systems]]></category>
		<category><![CDATA[google code]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[web security]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/2008/03/19/google-code-university/</guid>
		<description><![CDATA[Google Code University is an excellent resource for Computer Science students and programmers in general. All videos and Powerpoint presentations published at the University are released under Creative Commons. Four different kinds of courses are available right now, they are Ajax Programming, Distributed Systems, Web Security and Languages.]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/edu/">Google Code University</a> is an excellent resource for Computer Science students and programmers in general. All videos and Powerpoint presentations published at the University are released under Creative Commons. Four different kinds of courses are available right now, they are Ajax Programming, Distributed Systems, Web Security and Languages.</p>
<p>Each section is divided into two subsections that link to the presentations and videos. The Powerpoint presentations have to be downloaded to your computer while the videos are embedded on the website itself. Most tutorials on the website are clearly aimed at users with some background knowledge.</p>
<p>If you take a look at the C++ tutorials in the Language section you see that they are not beginners tutorials for instance. The first tutorial is named C++ Threads while the second and last New Features in the Next C++ Standard. Nothing a beginner to C++ programming would want to start with.</p>
<p><span id="more-3557"></span>The videos however are excellent, the C++ Threads video for instance has a playtime of 1 hour 29 minutes. Strangely though the other video which was hosted on Youtube is not available anymore which is the only video that was not available. All other videos were hosted on Google Video and ran fine.</p>
<p>The website has a Curriculum Search as well which should help to find teaching material. It&#8217;s basically a custom Google search.</p>

	Tags: <a href="http://www.ghacks.net/tag/ajax/" title="ajax" rel="tag">ajax</a>, <a href="http://www.ghacks.net/tag/coding/" title="coding" rel="tag">coding</a>, <a href="http://www.ghacks.net/tag/distributed-systems/" title="distributed systems" rel="tag">distributed systems</a>, <a href="http://www.ghacks.net/tag/google/" title="Google" rel="tag">Google</a>, <a href="http://www.ghacks.net/tag/google-code/" title="google code" rel="tag">google code</a>, <a href="http://www.ghacks.net/tag/languages/" title="languages" rel="tag">languages</a>, <a href="http://www.ghacks.net/tag/university/" title="university" rel="tag">university</a>, <a href="http://www.ghacks.net/tag/web-security/" title="web security" rel="tag">web security</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/11/20/youtube-videos-get-automatic-captions-1080p-videos-roll-out/" title="Youtube Videos Get Automatic Captions. 1080p Videos Roll-Out (November 20, 2009)">Youtube Videos Get Automatic Captions. 1080p Videos Roll-Out</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/08/21/youtube-insight-find-out-who-is-embedding-your-youtube-videos/" title="Youtube Insight: Find Out Who Is Embedding Your Youtube Videos (August 21, 2009)">Youtube Insight: Find Out Who Is Embedding Your Youtube Videos</a> (0)</li>
	<li><a href="http://www.ghacks.net/2005/10/14/yahoo-vs-google-vs-msn-search-commands-compared/" title="Yahoo vs. Google vs. Msn, Search commands compared (October 14, 2005)">Yahoo vs. Google vs. Msn, Search commands compared</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/10/05/xoopit-to-become-yahoo-mail-exclusive/" title="Xoopit To Become Yahoo Mail Exclusive (October 5, 2009)">Xoopit To Become Yahoo Mail Exclusive</a> (5)</li>
	<li><a href="http://www.ghacks.net/2009/06/15/x-ways-to-manipulate-websites-in-firefox/" title="x Ways To Manipulate Websites In Firefox (June 15, 2009)">x Ways To Manipulate Websites In Firefox</a> (6)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2008/03/19/google-code-university/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Preezo: Create Powerpoint Presentations Online</title>
		<link>http://www.ghacks.net/2007/09/30/preezo-create-powerpoint-presentations-online/</link>
		<comments>http://www.ghacks.net/2007/09/30/preezo-create-powerpoint-presentations-online/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 07:48:38 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Online Services]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[powerpoint]]></category>
		<category><![CDATA[preezo]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/2007/09/30/preezo-create-powerpoint-presentations-online/</guid>
		<description><![CDATA[Preezo is a fast powerpoint maker on the web. Like most of the web 2.0 apps it uses Ajax to power its site. To use the application you need to register and log in. The first thing I notice is there is no lag at all using the different features. It is very responsive. Even with Google Docs there is some lag while adding stuff. I would happily use this on my browser.]]></description>
			<content:encoded><![CDATA[<p>Preezo is a fast powerpoint maker on the web. Like most of the web 2.0 apps it uses Ajax to power its site. To use the application you need to register and log in. The first thing I notice is there is no lag at all using the different features. It is very responsive. Even with Google Docs there is some lag while adding stuff. I would happily use this on my browser.</p>
<p>There is a choice of six template layout. Although, that is too little compared to powerpoint, I feel it is enough for normal usage. You can change your font (20 font types to choose from), change background color or even use a image as a background. Speaking about images; There is a option for you to load a picture from your desktop. I have seen too many web 2.0 sites that require you to load the picture/photo from a url which is very inconvenient.</p>
<p><span id="more-2066"></span><img src="http://www.ghacks.net/files/screens/2007/09/preezo3.jpg" alt="preezo powerpoint presentations online" /></p>
<p>You can view your slides in the normal view (powerpoint view) or the slide sorter view (see above). Within the slide sorter view, you can drag and drop the slides to change the order. Nice for a web app.<br />
Slide show</p>
<p>You are able to view your slide show directly as you do your presentations by going to &#8220;view show&#8221;. The other 3 options are</p>
<p>1.	Email Show &#8211; share you presentation through email<br />
2.	Publish Show &#8211; Publish your presentation for live viewing<br />
3.	Embed Show &#8211; Embed a presentation on your blog, like I have done below (only 3 slides for testing)</p>
<p><iframe src="http://preezo.com/view.php?key=b193fa2ac68914f68801c3ffca344e92" frameborder="0" height="300" scrolling="no" width="400"></iframe></p>
<p>There are even cool slide transitions for you to play with. Good Stuff.</p>
<p>My main gripe with Preezo is that it cannot open existing powerpoint from your desktop. But to create a presentation from scratch, I totally recommended it. I think I will use this from now on.</p>
<p>This has been an entry from Yeong who runs his own blog <a href="http://blogmunch.com/">Blogmunch</a>.</p>
<p><strong>Read More:</strong></p>
<p><a href="http://preezo.com/">Preezo</a></p>

	Tags: <a href="http://www.ghacks.net/tag/ajax/" title="ajax" rel="tag">ajax</a>, <a href="http://www.ghacks.net/tag/microsoft/" title="microsoft" rel="tag">microsoft</a>, <a href="http://www.ghacks.net/tag/office/" title="office" rel="tag">office</a>, <a href="http://www.ghacks.net/tag/powerpoint/" title="powerpoint" rel="tag">powerpoint</a>, <a href="http://www.ghacks.net/tag/preezo/" title="preezo" rel="tag">preezo</a>, <a href="http://www.ghacks.net/tag/web-20/" title="web 2.0" rel="tag">web 2.0</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/07/19/google-docs-templates/" title="Google Docs Templates (July 19, 2008)">Google Docs Templates</a> (2)</li>
	<li><a href="http://www.ghacks.net/2006/11/29/watch-three-webcasts-get-vista-and-office-for-free/" title="Watch three webcasts get vista and office for free (November 29, 2006)">Watch three webcasts get vista and office for free</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/06/30/remove-hidden-data-tool-for-office-2003-and-office-xp/" title="Remove Hidden Data tool for Office 2003 and Office XP (June 30, 2008)">Remove Hidden Data tool for Office 2003 and Office XP</a> (2)</li>
	<li><a href="http://www.ghacks.net/2009/09/18/office-web-apps/" title="Office Web Apps (to be) Included Free In Windows Live (September 18, 2009)">Office Web Apps (to be) Included Free In Windows Live</a> (4)</li>
	<li><a href="http://www.ghacks.net/2008/03/05/office-live-workspace-beta/" title="Office Live Workspace Beta (March 5, 2008)">Office Live Workspace Beta</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2007/09/30/preezo-create-powerpoint-presentations-online/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
