• RyanDev.com

  • How To Use jQuery To Call A Function in iFrames.

22nd May 2010

How To Use jQuery To Call A Function in iFrames.

The jQuery .each() function is a great way to iterate over elements and even perform a function against them.  For example, if you have a web form that has multiple iFrames and you want to validate each of the forms all at once you can do the following jQuery call.     $(“iframe”).each(function(index) { try { this.contentWindow.Validate(); } catch (e) { } });1. $(”iframe”) - will select all iFrames in a given page.2. .each() - calls a function for each iFrame3. “this” inside of the each() function actually refers to the iFrame in this case.4. function(index) { try { this.contentWindow.Validate(); } catch (e) { } } - This accesses the actual page of each iFrame by calling contentWindow and then the name of the function Validate.  This means that each page that is loaded in an iFrame has its own Validate JavaScript function either directly or through an includes file.5.The call to Validate() is inside a try/catch block in the event that one of the pages may not have a Validate event.  That will throw an Exception which is not important for this example.

posted in jQuery | 4 Comments

21st May 2010

Employee Ownership

I used to believe that Employee Ownership was a great incentive to work for a company.  In fact, that was the deciding factor of my previous job.  I had three other offers besides the one I took and what really made the decision for me was that I would be a part owner of the company.  I took the job.

I then found out my boss had lied and that I would not have ownership, which is a different story altogether; however, when I found out the details of the ownership I was no longer upset about not getting ownership, I was only upset for ever taking the job.

The deal was you had to pay money to get the ownership.  How is that an employee benefit?  It is not.  I can own a part of any publicly traded company in the world including Microsoft, HP, IBM, etc., if I pay money.  That is referred to as buying stocks.

So, employee ownership can be a great benefit but not when you have to pay for it.   My previous job had supposed “employee benefits” but at the end of the day none of them were designed to benefit the employee.

posted in Management | 2 Comments

  • Links

  • Calendar

  • May 2010
    S M T W T F S
    « Apr   Jun »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031