<?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 &#124; Latest Tech News, Software And Tutorials &#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 news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Fri, 10 Feb 2012 13:29:21 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <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(&#8216;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> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/01/15/using-javascript-to-hide-and-unhide-elements-dynamically/feed/</wfw:commentRss> <slash:comments>33</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 Brinkmann</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> ]]></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 Brinkmann</dc:creator> <category><![CDATA[Online Services]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tools]]></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 Blogmunch.</p><p><strong>Read More:</strong></p><p>Preezo</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2007/09/30/preezo-create-powerpoint-presentations-online/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> </channel> </rss>
