Quote:
Originally Posted by allworknoplay
I've heard of Mootools mentioned around here. It goes up against jQuery and Prototype right? I feel like there's so many things out there, it's kinda overwhelming so I'm trying to take things one step at a time..
|
jQuery, scriptaculous, etc. is all implementations pointing to solve the "same problem". I like mootools because, its small, compact, does the job and is easy to write. Ofcourse any jQuery developer may say the same about jQuery, so it differs from the persons point of view.
Quote:
Originally Posted by allworknoplay
What is JSON? And if Mootools is a framework, does it go up against scriptalulous also? And what about joomla?
Sorry, for throwing out a lot of names...
|
JSON is data-interchange format, just like XML but it basiclly uses the same syntax as javascript closure objects, making it possible to eval json most of the times without a parser (but not recommeded to eval).
Quote:
Originally Posted by allworknoplay
Also one more thing, I assume that mootools can do the greybox effect? I'm not sure if that's the correct name of it...but it's when you want to view images and the whole browser becomes gray and the image appears in the middle, and it has that animated look...
|
I don't think mootools comes with that "out-of-the-box", but it surely shouldn't be hard to implement.
Quote:
Originally Posted by allworknoplay
|
I've seen the last question quite a few times, the technique is pure simple. For example:
HTML Code:
<input type="button" id="request" value="Request" />
<div id="response"></div>
Thats our HTML, where we want the response to be put at and the button to trigger the request. The following code is mootools API, but I'm sure you can figure the idea out:
javascript Code:
/* The mootools must have domready for this to work */
window.addEvent('domready', function()
{
/* Binds the event to the request button */
$('request').addEvent('click', function()
{
getResponse('response');
});
});
function getResponse(node)
{
/* And now for the ajax loader! */
$(node).set('text', 'Loading...');
/* And now call the ajax request */
/* ... */
}
So the "trick" is to change the value of the response area to the ajax loader before sending the request ;)