Blog Moved ....

ScottCate.com

community

frenz

my book(s)

my products

Testing Parameters in MS Ajax

Garbin has a great post that explains the possibility of creating a strongly typed collection in JavaScript. It’s very easy to read, and ends up with this sample code. This is all accomplished with a Function._validateParams that is built into the core library. It’s a nice short read, that explains the features very nicely.

 

function pageLoad() {

    var c1 = newsamples.Customer(); 
    c1.set_fullName('John Doe');   

    var c2 = new Samples.Customer(); 
    c2.set_fullName('John Smith');  

    var coll = new Samples.CustomerCollection(); 
    coll.addCustomer(c1); 
    coll.addCustomer("blah"); // This will throw.     

    coll.removeCustomer(c1);

    alert(coll.get_count());

}

 

Published with BlogMailr

Posted: Nov 08 2006, 08:45 AM by scott cate | with no comments
Filed under: ,

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)