[Javascript] Ajax - or whatever you call it.

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

[Javascript] Ajax - or whatever you call it.

Post by qarnos »

I'm working on an assembly code documentation generator with the nifty (I think) acronym: EGADS! - Easy Generation of Assembly Documentation from Source.

I'd like to add a cool feature to the documentation which you see here and there on the web (such as the wikipedia popups) where hovering over a link will bring up a little pop-up box showing a preview of the contents. I believe this technology is called Ajax, but I might be wrong since I don't know much about it and really don't care to learn it for myself!

I was wondering if anybody on here would be able to help me out? I'm basically looking for someone to write the script for me. I'd like to be able to display a popup box containing the first line of the description and the input/output registers. This would be handy for quickly checking something in the docs if you've forgotten which registers do what.

If anybody is interested, reply in this thread or PM me is you wish. By way of thanks you get your name in the credits.
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org

avatar courtesy of driesguldolf.
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

Hmmm... as far as I know that is not Ajax, but just "simple" javascript.

Ajax is a technology to change content without reloading the screen (to put it simple). All this is handled client-side with calls to the server (just like a real forms application).

A good example of Ajax is Gmail.
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

mootools is an excellent JavaScript framework. It even supports tooltips out of the box. :)

With the mootools tooltips, you could give each link a classname to identify it as a tooltip, and then store the tooltip contents in the title attribute. Like this:

Code: Select all

<a href="somelink.htm" class="tip" title="function_name :: This function does something awesome.">function_name</a>
To then add popups, you'd simply need this snippet of JavaScript:

Code: Select all

window.addEvent('domready', function() { new Tips($$('a.tip')); });
This doesn't use AJAX, and requires that the content is known beforehand. As you're outputting static HTML (rather than generating these documents on the fly using a server-side application), there isn't a huge advantage to using AJAX.
User avatar
Demon
Regular Member
Posts: 85
Joined: Wed 31 Jan, 2007 12:11 am
Location: (806), Texas
Contact:

Post by Demon »

There's also JQuery and Prototype.
I heard that JQuery is really good.
I'm a Prototype guy for now. Takes a bit more code to do stuff with Prototype, but after seeing some of JQuery's examples, I'm really thinking about switching.
"Python has dynamic typing, and dynamic binding, which means that not only does it make a great secretary, it is also pretty damn kinky." --Henry the Adequate

<My Artwork>
Post Reply