Archive for the ‘ Javascript ’ Category

Calling parent window from an iframe

When loading an iframe inside your parent window using lightbox / multibox, etc you would think window.opener would be the most suitable use to call your parent window; However this won’t work in most circumstances. The following should get your out of trouble:

Read more

Useful Plugins and Resources For MooTools

MooTools is a fantastic object oriented JavaScript framework; It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API. Most of us who have ever used MooTools will testify that it is as good as jQuery if not better. But if you compare the popularity levels between the two frameworks, jQuery is far ahead of MooTools.

Read more

Alternative Rows Colors With CSS and Mootools


/* load alternate row colors in a table */
function loadAltRowColors() {
if($$('table.myStyle')) {
var count = 0;
$$('tr.dynRow').each(function(elm) {
(elm.hasClass('odd') ? elm.removeClass('odd') : elm.removeClass('even'));
});
$$('tr.dynRow').each(function(elm) {
elm.addClass(count++ % 2 == 0 ? 'odd' : 'even');
});
};
};

Mootools, Ajax forms and tinyMCE

Submitting a form via ajax but using tinyMCE at the same time? Run into the problem where tinyMCE content won’t post via ajax? I may have the solution for you! ;)

Read more

5 Great MooTools Plugin Resources

One of the strengths of the MooTools javascript library is that the code is so flexible. This flexibility allows almost anyone to download the core and create plugins to their heart’s content. Why reinvent the wheel if you don’t have to though? Check out these fine websites which are loaded with easy to implement plugins.
Read more

What JavaScript Is Good For

Part of making this choice is asking what you want to do with JavaScript. Let’s consider vanilla JavaScript. No framework; just plain old JS. JavaScript gives you native objects like Strings, Numbers, Functions, Arrays, Dates, Regular Expressions, and more. JavaScript also gives you an inheritance model – a somewhat esoteric model called prototypal inheritance (which I’ll talk about more later). These building blocks and the concept of inheritance are the bread and butter of any programming language and they have absolutely nothing to do with browsers or the web or CSS or HTML. You could write anything you wanted to in JavaScript. Tic-tac-toe, chess, photoediting, a web server, whatever. It just so happens that 99% of all the JavaScript out there is run in browsers and that’s what we think of it as. The programming language for browsers.

Understanding that the browser, the DOM, is just where we happen to use JS most of the time but that it’s actually a very robust and expressive programming language will help you understand the difference between MooTools and jQuery.

Read the rest at jqueryVSmootools.com

MooTools TwitterGitter Plugin

Everyone loves Twitter. Everyone loves MooTools. That’s why everyone should love TwitterGitter, a MooTools plugin that retrieves a user’s recent tweets and allows the user to format them however the user would like. TwitterGitter allows the user to choose the number of tweets to retrieve and returns an object containing the data provided by Twitter.

http://davidwalsh.name/mootools-twitter-plugin

Punkbuster Server Message Generator Upgraded

A long overdue upgrade has been completed on the Punkbuster Server/Console Message Generator for Call of Duty 4/5. I fixed a few bugs in the system that related to the comma and quotes being put within the string of the messages. Also I fixed the Select All feature and added a Save function.

The Save feature offers you a way to store your messages on a public accessible list where you will be emailed a specific link and message ID so you can edit it at a later date without having to re-enter in your messages over and over again each time you wish to make a change. Now I said publicly accessible, and yes everyones messages will display in a rotating window at the bottom of the page. This is a trial and I am open to feedback on this new system.

Be sure to check it out: COD4/WaW Punkbuster Server Message Generator v1.4

Read more

mooplugins.com goes beta!

The mooplugins.com website is now live for mootools developers t signup and for members to get their accounts registered. The site is still in beta but once we get a few registrations on board and test the site out and add more features along the way it will go live.

Check it out: mooplugins.com

mootools vs jquery

So, why mootools?

  1. Class support.
    JQuery’s SQL-like syntax is fine for quick and dirty javascripting, but eventually you’ll want real classes to structure your UI logic.
  2. It smells, feels and tastes like regular javascript.
    JQuery doesn’t even look like javascript, which isn’t necessarily a bad thing, since that’s kind of their goal. MooTools however, feels like just an extension of the language (more on this at point #9).
  3. Read more

MooTools Plugins Repository – Coming Soon

I am currently working on a project called: Mootools Plugin Repository. It’s the unofficial mootools plugin repository for all the mootoolers out there like me. I’ll give you a quick run-down on what we aim to achieve with the site:

  • Support for 3rd party plugins for v1.11 & v1.2
  • Project Profiles
    • Comments
    • Ratings
  • Search
    • Advanced Search
  • Member Accounts
  • Upload Previews and demos
  • Digg.com features
  • No Ads!
  • Run all by mootools <3 :)

We hope to have this up and running for you mootoolers soon.

Detect Google Chrome via JavaScript

As we all know Google has released their own web browser called: Chrome. As a web developer when I first heard about it my first thoughts where; “oh great, another browser to check for and to load certain style sheets etc etc etc”. However, that’s not the case, Google Chrome is built off the Apple WebKit just like Safari.

The only problem I for-see with Google using WebKit is that most browser detection done via javascript is going to return Safari not Chrome!

How do we overcome this?

var is_chrome = navigator.userAgent.toLowerCase().indexOf(‘chrome’) > -1;

Chrome’s full user agent:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13