New York Design & Development Forums

Go Back   New York Design & Development Forums > Development > Website Programming
Connect with Facebook

Notices

Reply
 
LinkBack Thread Tools
Old 01-01-2007, 04:48 AM   #1 (permalink)
Moderator
Aficionado
 
Contention's Avatar
 
Join Date: Mar 2003
Age: 33
Posts: 147
Contention is on a distinguished road
Default How to Easily AJAX Your Website

How to Easily AJAX Your Website
Source: Download Squad

Script.aculo.us is an amazing framework for enriching your website's user experience very easily. Built on top of the very popular prototype javascript framework, scriptaculous makes AJAX cake, and gives everyone the power to have a sexy AJAX-powered website, yes everyone. Scriptaculous is a tiny (140kb) javascript framework that gives you the power of effects, several dynamic data components, and all you need to know is a little bit about HTML and how to read. If you already have your own website, it is not hard to do. Follow these steps to AJAX up your site in no time:
  1. Download script.aculo.us - web 2.0 javascript. Click on any of these links to begin downloading the zip, tar.gz, or tar.bz2 version.
  2. Unzip the archive somewhere, preferably somewhere you will find it again. This is key.
  3. Upload the whole thing to your web server, and put it where ever you like, again, it should be somewhere you can find it. Once again, finding it is key. You will need to link to these files from your web page, so putting the files in a sub folder of your home directory (root for you unix junkies) is a good idea.
  4. In the header section of your web pages, you need to put this code:
    Code:
    <script src="ajax/prototype.js" type="text/javascript"></script>
    <script src="ajax/scriptaculous.js" type="text/javascript"></script>
    
    As you might notice, the code has to point to your uploaded script.aculo.us files. You would replace the "ajax/" portion with your own path depending on the name of your subfolder.
  5. Next, put the one line of code into your pages or posts where ever you want the effect to take place. Let's say you have a content div element you want to have all the sudden appear in the page, all you do is wire the "SlideDown" effect (one of many in script.aculo.us, download the cheat sheet here) to a button, link, or other clickable element on your page. The code to trigger the SlideDown effect from a link looks like this:

    Code:
    <a href="#" onclick="Effect.SlideDown('content');">SlideDown Now!</a>
    
    Why use an <a> tag? First, it is super simple to code (everyone knows it), and second, users think it is an ordinary link. They will be quite surprised when they find out it isn't normal at all. I call this "hacking old-skool users into using web 2.0 unknowingly" (or something like that).
  6. Anyway...be sure your div tag has the id="content" because that is the name of the element the SlideDown effect will be applied to once you click the "link" we just made. Make sense? Good. NOTE: Something to remember is that your DIV will be shown on the page automatically by default, unless you first hide it, so the visual magic of an effect such as SlideDown can really be displayed. To "hide" our div by default so your content won't appear until you click the link we just made, you will need to add an inline CSS style (or add one in your CSS file, if you have one) so the content div ends up looking like this:
    <div id="content" style="display: none;">This is the content.</div> You'll notice (I hope) that the underlined code is the part that hides this div by default. When the SlideDown effect is triggered by clicking on the <a> link, it will automatically change the div's display property, so don't worry about having to do that.
  7. Try it out, and have fun! It should slide down your content, which can be anything you put in that div tag, video, audio, pictures, more javascript, an iframe, whatever, use your imagination. There are tons of different effects you can use, so you should check them out at script.aculo.us's website, since they have great demos and even combination demos for different sets of effects.

    Since the script.aculo.us wiki is large and contains a lot of information to consume all at once, I have compiled a basic script.aculo.us effects cheat sheet of sorts for your quick and dirty coding enjoyment. You can download my PDF cheat sheet here.
Have fun AJAXing your site, and once you're done, come back and give us a link to your site so we can see what you've done with the place. I'd love to check out your site with the framework in action. It can do some wicked cool stuff. You can build entire sites out of script.aculo.us including AJAX drop-downs, AJAX page loading, and custom stuff. Let me know how your site turns out with it.

NOTE (to lightbox and TinyMCE users): There are some special instructions on integrating script.aculo.us with both of these other frameworks, since they all use Prototype to some extent. You can find TinyMCE help here (script.aculo.us wiki) and most lightbox frameworks list this info on their support page or forums section of the site. Have fun!
__________________
Misc Tutorials:
Interval Manager - Tutorial on Flash Interval Managers
Ajax Tutorial - Simple Ajax tutorial for beginners
CSS Tabs - Tutorial on creating CSS tabs
Posting Guide - Some things you should read before posting
Contention is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Old 01-02-2007, 01:42 PM   #2 (permalink)
Administrator
Enthusiast
 
johnboulder's Avatar
 
Join Date: Mar 2003
Posts: 97
johnboulder is just really nicejohnboulder is just really nice
Send a message via MSN to johnboulder Send a message via Skype™ to johnboulder
Default Re: How to Easily AJAX Your Website

Just a minor comment here to clarify what seems to be a misinterpretation of the term 'AJAX'.

AJAX is a technology built on top of (in large part, using) XMLHttpRequest, in it's previous incarnation, it was called xml-rpc, and was what google uses for it's 'AJAX' sites, as xml-rpcis still tremendously powerful.

AJAX relates to the way data is retrieved from the server - Asynchronously, through Javascript using Activex to return XML.

As such, script.aculo.us, though a wonderful and complete set of effects to jazz up any website, and despite including a few AJAX functions, such as autocompletion and 'editable fields' is not in itself, AJAX - it is in effect a set of useful routines for use by web designers and developers for the front end, whereas 'AJAX', by definition relates to the pulling of information from the back end to the front end in a refreshless manner.

Likewise, Javascript menus are not AJAX, merely a set of interface enhancements.

Sorry if I've gone on a bit - it seems to be a common misconception at the moment.

Regards
__________________
Sean Johnstone
Johnboulder Resources
Tutorials:
CSS: Tabs - Tutorial on creating navigation tabs using CSS
PHP: Custom User Authentication - Tutorial on PHP custom user authentication
johnboulder is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Old 02-22-2010, 06:04 AM   #3 (permalink)
Junior Member
Newb
 
Join Date: Feb 2010
Posts: 10
charlieangles is on a distinguished road
Default Re: How to Easily AJAX Your Website

I had made some mobiel Applications with the use of the Ajax tool in the ASP.Net 2005. AJAX Your Website is really excellent work. Morever it was really wonderful experience when I had Ajax my website.
__________________
Web Design Kent
charlieangles is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX: Simple Tutorial seco Tutorials 20 10-28-2011 05:58 AM
What is AJAX? melissajean85 General Conversation 1 11-26-2006 06:35 PM


All times are GMT -4. The time now is 10:48 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45