Hi

I guess you have your $().ready() function in an external js file,
otherwise you could
customize it for the according html page.

Another construct similar to Ricardos one, but a bit more flexible:

Use a global variable in every html file to specify the init functions
you want to call for this page:
<script type="text/javascript">
        myInitFxn = [ManageCategoriesClick, HideByDefault, 
PrepareSplitForm,...];
</script>

ready.js:
$().ready(function(){
        for(var i in myInitFxn) {
                myInitFxn[i](); // call init function
        }
});

by(e)
Stephan


2009/2/8 brian <bally.z...@gmail.com>:
>
> On Sat, Feb 7, 2009 at 11:21 PM, Ricardo Tomasi <ricardob...@gmail.com> wrote:
>>
>>
>> Alternatively you could add a different class to the body of each
>> page, then use this rather amusing construct:
>>
>> $(document).ready((function(){
>>  var is = function(v){ return ++document.body.className.indexOf(v) };
>>
>>  return(
>>   is('categories')
>>     ? ManageCategoriesClick :
>>   is('hidebydefault')
>>     ? HideByDefault :
>>   is('form')
>>     ? PrepareSplitForm :
>>   is('advert')
>>     ? SetUpAdvertPopup :
>>   function(){} //nothing
>>  );
>>
>> })());
>>
>
> That is, indeed, amusing. And one for my toy chest. Thanks!
>
> Who knew, back in '96, that javascript was going to turn out to be so much 
> fun?
>

Reply via email to