I have this all wrong and its not working.
I'm trying to call one shared function to alert data passed that is called from two different click events but |I get underfined in the alert. Why do I get underfined?
var myF = function(){
alert('a click ' + this.model + ' ' + this.year); // meant to alert the properties of the object passed to it
alert(this.ID); // meant to alert the ID of the click that called it
};
var myCar = new Object();
myCar.make = "Ford";
myCar.model = "Mustang";
myCar.year = 1969;
var myCar2 = mycar;
myCar2.make = "VW";
myCar2.model = "golf";
myCar2.year = 2000;
$('.feature1').click(myCar,myF);
$('.feature2').click(myCar2,myF);