How to pass an object from a link to a function

How to pass an object from a link to a function

Environment is MVC with jQuery. I built a cut down example to show my problem:

From my web page I consume getDogs  from my Controller:
  1.  public ActionResult getDogs()
  2.         {
  3.             List<Dog> myDogs = new List<Dog>();
  4.             Dog d = new Dog();

  5.             d.dogName = "Doc";
  6.             d.dogBreed = "Many";
  7.             myDogs.Add(d);

  8.             d = new Dog();
  9.             d.dogName = "Sadie";
  10.             d.dogBreed = "Boston Terrier";
  11.             myDogs.Add(d);


  12.            
  13.             return Json(myDogs);
  14.         }

In my page, using jQuery.each, I create a list of links showing each dogs name. In the on click of the link I want to pass the dog object into a function where I would access the dogName property. For this example I just alert it.  The message I get is undefined. I know how to pass individual properties both singular and multiple to a function. I can't seem to pass the object.

Thanks!
  1. <script>
  2.     $(document).ready(function () {
  3.         getDogs();
  4.     });

  5.     function getDogs() {

  6.         var myUrl = ' /ScratchPad/getDogs/ ';
  7.        
  8.         $.post(myUrl, null, function (data) { landGetDogs(data); }, 'json');
  9.     }

  10.     function landGetDogs(x) {
  11.         $('#dogs').empty();
  12.         jQuery.each(x, function () {
  13.             $('#dogs').append("<li style='font-size:10px;margin:0;padding:0;margin-left:40px;list-style:none' ><a href='#' onclick='viewDog(" + '"' + this + '"' + ")'>" + this.dogName + "</a></li>");

  14.         });
  15.     }

  16.     function viewDog(x) {
  17.         alert(x.dogName);
  18.     }
  19. </script>